B
Ben
Hey,
I've got two threads running at a point in time which are generated by
this code.
Thread oTdFillOffices = new Thread(new ThreadStart(FillOffices));
oTdFillOffices.Name = "FillOffices";
oTdFillOffices.IsBackground = true;
this.oThreads.Add(oTdFillOffices);
oTdFillOffices.Start();
Thread.Sleep(10);
Thread oTdFillContacts = new Thread(new ThreadStart(FillContacts)); //#2
oTdFillContacts.Name = "FillContacts";
oTdFillContacts.IsBackground = true;
this.oThreads.Add(oTdFillContacts);
oTdFillContacts.Start();
Thread.Sleep(10);
Within the first thread (FillOffices), i get to this line of code and
get an error.
System.Data.SqlClient.SqlDataAdapter oAdapter = new
System.Data.SqlClient.SqlDataAdapter("SELECT ID,Office,Company FROM
Office", oConn);
The error being ... :
A first chance exception of type 'System.IndexOutOfRangeException'
occurred in system.data.dll
Additional information: There is no row at position 0.
When that error occurs, i always seem to be at the line marked by the #2
in the parent thread. So it hasn't actually started a third thread yet.
Anyone have any ideas? because I'm running out
Thanks!
Ben
I've got two threads running at a point in time which are generated by
this code.
Thread oTdFillOffices = new Thread(new ThreadStart(FillOffices));
oTdFillOffices.Name = "FillOffices";
oTdFillOffices.IsBackground = true;
this.oThreads.Add(oTdFillOffices);
oTdFillOffices.Start();
Thread.Sleep(10);
Thread oTdFillContacts = new Thread(new ThreadStart(FillContacts)); //#2
oTdFillContacts.Name = "FillContacts";
oTdFillContacts.IsBackground = true;
this.oThreads.Add(oTdFillContacts);
oTdFillContacts.Start();
Thread.Sleep(10);
Within the first thread (FillOffices), i get to this line of code and
get an error.
System.Data.SqlClient.SqlDataAdapter oAdapter = new
System.Data.SqlClient.SqlDataAdapter("SELECT ID,Office,Company FROM
Office", oConn);
The error being ... :
A first chance exception of type 'System.IndexOutOfRangeException'
occurred in system.data.dll
Additional information: There is no row at position 0.
When that error occurs, i always seem to be at the line marked by the #2
in the parent thread. So it hasn't actually started a third thread yet.
Anyone have any ideas? because I'm running out

Thanks!
Ben