Exception:Assign : Min (114) must be less than or equal to max (-1) in a Range object

datatable
error

#1

Hi
Can some one please help with the following error message?

Assign : Min (114) must be less than or equal to max (-1) in a Range object.

It is displayed as ‘Argument Exception’. I encountered this while using dt.select().

Regards,


#2

Hey @Shatakshi_Mishra

The above problem starts with your select query expression, it looks like a numeric expression to the query parser, not a string.

There is things in the background about index which builds with string so just whatever variable you are using i guess that is of Int32 type just convert that into String by using .ToString() then it should solve your problem.

Regards…!!
Aksh


#3

Hey @aksh1yadav Thanks for replying
I am using assign activity as below,

dte = Exl1.Select(“Dt =’”+stDaEx_3+"’")(0)(“Day”).ToString()

where,
Dt is the column name,
stDaEx_3=row(3).ToString()
Day is column name.

I am still getting the error. : (


#4

Did you try using Lamda Expression?

Exl1.AsEnumerable.Where(Function(r) r.Field(of string)("Dt")=stDaEx_3)(0)("Day").ToString

Someone else had same issue in the past, not sure if it got resolved.


#5

Hey @vvaidya Thanks for replying!
I tried doing what you have showed but that gives an error:

'Unable to cast object of type ‘System.DateTime’ to ‘System.String’ '.

Same holds true for other data types as well, Unable to convert to string.


#6

Did you try modifying the types(Column & Variable) to DateTime ?


#7

It’s showing the same error for any data type.
Somehow the ToString() is not getting invoked.


#8

Hi @Shatakshi_Mishra, have you ever solve this problem? I met the same situation when using Datatable.Select.
It’s like:
totalTable.Select(“Start Date = '”+row.Item(“A”).ToString+"’ and End Date = ‘"+row.Item(“B”).ToString+"’")

I guess it might caused by one of the column I used to select is date format but I can’t find the solution.


#9

Is there a solution to this?
I’m doing: dtFiltered = dtFacturiRidicata.Select("[Nr. Fiscal Fact] = '"+dtDistinctFacturi.Rows(InvoiceCounter).Item("Nr. Fiscal Fact").ToString+"'").CopyToDataTable and I’m getting: Invoke GetTransactionData workflow: Assign : Min (1464) must be less than or equal to max (-1) in a Range object.