Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

  • *Experts*
Posted

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

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Posted

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

Posted

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...