All,
I have a Windows Service which queries a database (SQL Server) for some data. What is the best way to store that data for later usage and can very accessed very easily? Maybe a DataTable ?
Rgds, MK
All,
I have a Windows Service which queries a database (SQL Server) for some data. What is the best way to store that data for later usage and can very accessed very easily? Maybe a DataTable ?
Rgds, MK
I would recommend you using the built-in caching provider. You could also extend it to work with other caching providers such as memcached, ... if you start running out of memory on your web server and would like to distribute the cache across a web farm (very scalable).
A DataSet is a good start, but depending on lots of factors as Steve suggested there may be completely other ways be the optimal solution.
Maybe you put the data in business objects and put these into a hashtable which can then be accessed later by key .
You can use DataTable for table data storage or DataSet for multi-table data cache with relations, views and extra build in functionality. All depends of data structure which you want to manage. If data structure is simple - mayby best way is create your own specified data structure and manage it by linq or other code. DataTable and DataSet are not always lightweight but usually fast enough and easy to access and at last quite universal.