using threads with database connections

K

kt

I am creating an application where i want to create a thread that will
get data from one database and another thread that will get data from
another database.I am using .net remoting to get the data and am
getting the data in two datatables and then joining them and
displaying the information in a datagridview. The application is
working fine without threads..but as soon as i create two threads and
call the methods to retrieve data from the databases, i get a null
datatable. It does not return me data in the datatable. Can anyone
help me out with this problem??? I am using the Thread class to create
the threads.
 
J

Jon Skeet [C# MVP]

kt said:
I am creating an application where i want to create a thread that will
get data from one database and another thread that will get data from
another database.I am using .net remoting to get the data and am
getting the data in two datatables and then joining them and
displaying the information in a datagridview. The application is
working fine without threads..but as soon as i create two threads and
call the methods to retrieve data from the databases, i get a null
datatable. It does not return me data in the datatable. Can anyone
help me out with this problem??? I am using the Thread class to create
the threads.

Could you post a short but complete program which demonstrates the
problem?

See http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.
 
N

Nicholas Paldino [.NET/C# MVP]

Well, how are you passing the data tables returned from the calls in the
other threads to the main thread and then merging them?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top