I have a Race condition where each time I run my code, the number of items returned changes and is slightly different for each run but if I step through the code, I see all records as expected.
My gut is that I was trying to make the db call thread same and was using IAsyncResult to accomplish that. I may be way off track here...
In my main program, I am instantiating a class that does some SQL DB work like this:
Database db = new Database();
public void BeginDatabaseCall()
SqlConnection conn = new SqlConnection(strMyConnectionString);
SqlCommand cmd = new SqlCommand(sql,conn);
public void EndDatabaseCall(IAsyncResult result)
SqlCommand cmd = result.AsyncState as SqlCommand;
using (SqlDataReader reader = cmd.EndExecuteReader(result))
Thanks in advance for any assistance or guidance you can provide on this topic.