Hello, all I found a strange issue while trying to fill a datatable from C# using ExecuteReaderAsync command. The problem seems to be in DataTable.Load() function. For the same exact SQL when I use this code (returns 201 rows): //-------------------------------- cmd = (SACommand)cmd; CancellationTokenSource cts = new CancellationTokenSource(cmd.CommandTimeout * 1000); var ret = await cmd.ExecuteReaderAsync(CommandBehavior.SingleResult, cts.Token); return (SADataReader)ret; //---------------------------------- Less rows return than when I use old adapter code (returns 231 rows): //--------------------------------- var sqlDataAdapter = new SADataAdapter((SACommand)tempinput); sqlDataAdapter.Fill((DataTable)ret.DataTable); //------------------------------------ Can someone point me into the direction of how this can be fixed. I did check that even if the async part is removed, the number of returned rows is still incorrect (lower than it should be) What can I check here? UPDATE: I see that if I add order by to my stored procedure in the SQL it returns even more rows than it should. There are duplicate rows in the result set, which makes 0 sense. Any ideas? UPDATE 2: When using "select * from proc", instead of "call proc" the returned data is correct. Thank you Arcady |
Hard to tell without knowing the procedure's definition... does the difference in returned rows also apply when calling the procedure within DBISQL?
Could it be the RESULT clause of the procedure does not fit the SELECT within the procedure's beody?
Within DB ISQL the result is always correct. This seems to be an issue with defining unique rows in DataReader of SQL anywhere result rows