I am trying to execute a query and it gives this error… i generated this list from a data column and its over 100,000 if i choose to pick them in chunks of 1000 means the query would have to run 100 times and this would slow down my process.
Any work around please
I used And milliDTA.AsEnumerable().[Select](Function(x) x(0).ToString()).Aggregate(Function(a, b) String.Concat(a, “‘,’” & b)) to generate the string that way
they are really above 100,000 for today and are all distinct … this is the first time i am encountering this and i didn’t build the process to handle such an instance … hence its making the code to run in almost infinite loop
@supermanPunch The thing is that normally the logic there was like our previous logic… it takes 1000 rows of the data table converts it to a list of string and runs the query , then goes for the next until its done with the entire row.
But this time the rows are 100,000 and its going to have to do this 100 times…
which is so slow.
now i decided to change the row chunk to 10,000 and i got that error after changing it.
i discovered maximum strings in a list can only be 1000 strings …
@MasterOfLogic That error is a known issue according to this Topic :
Maybe You can read the Complete Table from the Database as a Datatable and then apply the Filter Condition using that String using a Linq. Have you tried it ?
I may have to check the previous post to understand it completely again
“Select msg_num,session_num,response_code,reversal_num,payment_num From xxx.xxx_xxxxx_xxxxx@xxx_xxxxx Where message_id in (’” + sessionStrings + “’) or message_id in (’” + sessionStrings + “’) ”… but i really don’t know what logic would split session strings into chunks again … i try to think of one it confuses me…lol
This we can do it but again it is around 100000 so there would be multiple Or’s. But this data is also not fixed so we can’t make it dynamic and hence I don’t think we can use it