1
Answer

Getting Exception: 'ImageSize.Width' should be between 1 and 256

Photo of tom

tom

16y
7.6k
1
Hi All, I am adding an image (having Dimensions: 467x467) to an ImageList and setting the size of image list equal to this image as: myImageList.ImageSize=myImage.Size; but I am getting the exception: 'ImageSize.Width' should be between 1 and 256. Is it possible to have an Image in the ImageList of bigger Size than 256, or any other workaround. Thanks.

Answers (1)

0
Photo of Nitin Sontakke
NA 11.7k 2.2k 7y
I must admit that I don't quite understand your code. However, it is not quite clear which column of which table exactly here has unique index / primary key declared.
 
Also not clear how exactly, are you reproducing scenario of two inserts at identical time.
 
Also, not clear how a duplicate row can possibly get inserted when unique key is defined.
 
0
Photo of Rakesh Singh
NA 10 321 7y
Hi Nitin,
yes, we have created unique index for the below sample table:
 
 
DECLARE @falics TABLE (Id int, faliId int, TimeId int)
INSERT INTO Table1
( ForecastLineItemId
, TimeId
, CurrencyAmt
, CreateUserId
, CreateDttm
, UpdateUserId
, UpdateDttm)
OUTPUT INSERTED.ForecastLineItemCellId, INSERTED.ForecastLineItemId, INSERTED.TimeId INTO @falics
SELECT
ForecastLineItemId
, TimeId
, CurrencyAmt
, CreateUserId
, CreateDttm
, UpdateUserId
, UpdateDttm
FROM @adjustmentCellsTable
ORDER BY ForecastLineItemId, TimeId
SELECT Id FROM @falics ORDER BY faliId, TimeId
and we have the below sample insert query: 
sb.AppendLine("INSERT INTO Table1 ")
sb.AppendLine(" (ForecastVersionId ")
sb.AppendLine(" ,[CostCollectorId] ")
sb.AppendLine(" ,AdjustmentDesc ")
sb.AppendLine(" ,AdjustmentTypeCd ")
sb.AppendLine(" ,ElementCategoryId ")
sb.AppendLine(" ,CurrencyCd ")
sb.AppendLine(" ,AdjustmentAmt ")
sb.AppendLine(" ,SpeculativeInd ")
sb.AppendLine(" ,CreateUserId ")
sb.AppendLine(" ,CreateDttm ")
sb.AppendLine(" ,UpdateUserId ")
sb.AppendLine(" ,UpdateDttm ")
sb.AppendLine(" ,LastUpdateDttm) ")
sb.AppendLine(" VALUES ")
sb.AppendLine(" (@ForecastVersionId ")
sb.AppendLine(" ,@CostCollectorId ")
sb.AppendLine(" ,@AdjustmentDesc ")
sb.AppendLine(" ,@AdjustmentTypeCd ")
sb.AppendLine(" ,@ElementCategoryId ")
sb.AppendLine(" ,@CurrencyCd ")
sb.AppendLine(" ,@AdjustmentAmt ")
sb.AppendLine(" ,0 ")
sb.AppendLine(" ,@CreateUserId ")
sb.AppendLine(" ,@CreateDttm ")
sb.AppendLine(" ,@UpdateUserId ")
sb.AppendLine(" ,@UpdateDttm ")
sb.AppendLine(" ,@LastUpdateDttm ) ")
sb.AppendLine("SET @ForecastLineItemId = SCOPE_IDENTITY() ")
 
 
0
Photo of Nitin Sontakke
NA 11.7k 2.2k 7y
Please elaborate a bit. Share some code may be from back-end. 
 
How exactly are managing to test this scenario.
 
Which column you want to be unique? Have you already created primary key / unique index  on that column?