Loading a Dataset asynchronously from SQL + VB.NET

aah_what

Newcomer
Joined
Aug 18, 2003
Messages
7
Hi,

I would like to know if anyone knows how to load a dataset asynchronously and if anyone has an example.

I have tried using threading but when I move the form it gives an error - "OBJECT NOT SET TO AN INSTANCE OF AN OBJECT"

Is there anybody that can help with either of the problems? I am using windows forms and a sql backend.

Thanks

Matt
 
You can use a WebService which returns a DataSet. Use the Begin___ and End___ webservice methods to handle the data asyncronously. I don't think you'll be able to do anything with the DataSet until it's completely retrieved though. Meaning, you should call the End___ method in or before Form_Load.

If you want a more built-in asynchronous method of getting data, use a DataReader. You can always pump the data into a DataSet as it's retreived if that's what you want.

-Ner
 
Hi,

I do not want to use a datareader or a web service. I want to load a dataset through a datadapter because the data in the dataset is going to be altered later and then updated.

Is there a way of doing this async?

Matt
 
Hi Derek,

Thanks, that sounds like what I want to do, do you have an example of the code to do it, please?

Matt
 
Hi Sam,

Maybe you can help me then, I had my app set up like this. It starts off with the mainform opening and then shows another form that loads with threads like you have. After a while and especialy if I move the form around or anything I get an error.

"OBJECT NOT SET TO AN INSTANCE OF AN OBJECT"

If it is in release mode, a thread error comes up and the program terminates.

Have you got any other Ideas?

Matt
 
Maybe you can link to a zip of your project here, then we can all have a look at it. (or email it, as long as its only a couple meg)
 
Back
Top