aah_what Posted September 2, 2003 Posted September 2, 2003 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 Quote
*Experts* Nerseus Posted September 2, 2003 *Experts* Posted September 2, 2003 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 Quote "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
aah_what Posted September 3, 2003 Author Posted September 3, 2003 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 Quote
samsmithnz Posted September 3, 2003 Posted September 3, 2003 Why is it so important to do this async? What are you trying to do while you're extracting the data??? Quote Thanks Sam http://www.samsmith.co.nz
*Gurus* Derek Stone Posted September 3, 2003 *Gurus* Posted September 3, 2003 Start a thread, pass it a delegate and have it return when the DataSet has been loaded. Quote Posting Guidelines
aah_what Posted September 3, 2003 Author Posted September 3, 2003 Hi Derek, Thanks, that sounds like what I want to do, do you have an example of the code to do it, please? Matt Quote
samsmithnz Posted September 4, 2003 Posted September 4, 2003 Here, have a look at this demo about Multithreading I created a couple of weeks ago. Quote Thanks Sam http://www.samsmith.co.nz
aah_what Posted September 5, 2003 Author Posted September 5, 2003 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 Quote
samsmithnz Posted September 5, 2003 Posted September 5, 2003 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) Quote Thanks Sam http://www.samsmith.co.nz
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.