Вопрос

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 ?

Это было полезно?

Решение

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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top