Caching my dataset

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I have a desktop app written in vb.net. It takes a wile to load from sql server via a stored proc. Is there a way I can cache the dataset so that If i reopen the the program it loads faster. The data in the database doesn't change that often. Where can I find info on this?

Thanks
 
The first thing I'd determine is why is it taking so long and try to address
that issue. However that's obviously not your question. Anyway, you can
use dataSet.WriteXML to serialize it locally, just specify a local path.
Then when your app starts, check for the existence of the file and use
ReadXML if it does. All you need to do is pass in the path/file at a
minimum although specifying schema will speed things up dramatically. One
warning though, if you have a lot of data ie >1000 records, this is probably
not going to be the fastest thing in the world either depending on teh
schema of the dataset.

--
W.G. Ryan MVP Windows - Embedded

Have an opinion on the effectiveness of Microsoft Embedded newsgroups?
Let Microsoft know!
https://www.windowsembeddedeval.com/community/newsgroups
Chris said:
Hi,
I have a desktop app written in vb.net. It takes a wile to load from sql
server via a stored proc. Is there a way I can cache the dataset so that If
i reopen the the program it loads faster. The data in the database doesn't
change that often. Where can I find info on this?
 
Thanks for the response. The reason my sp is taking that long is that I am quering a progress database frpm sql server via openquery to get data. The result is less that 30 rows. What do mean by "specifying schema will speed things up dramatically"?

Thanks
 
Back
Top