Question

I developed a C# application which needs to read data from a database.

If I run this application on the server where the database is stored, it's fast, but, if I run this application by network, the SQL query is slow.

I would like to modify my program in order to store a first request answered in application memory, and secondly be able to do another SQL query on memory (in order to don't use network transfer).

Is there any possibilities to do SQL query in a datareader ?

Or maybe I need to use a Dataset ?

Was it helpful?

Solution

Yes. ADO.NET gives you that option. Load a DataTable with your data or a DataSet if you have more then one table. You can store this locally in memory and you can query your DataTable and sort and filter rows almost like real Sql database. You can issue Inserts/Updates/Deletes on specific rows and you may want to refresh data periodically. YOu will be limited only by amount of memory on the machine which stores the data in memory.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top