开发者

Disconnected DataSet

DataContext/Entity Model always read data from Database. is 开发者_JAVA技巧there any way DataContext/Entity Model will read the data from DataSet.

Thanks


Check out Linq-to-DataSet

LINQ to DataSet makes it easier and faster to query over data cached in a DataSet object. Specifically, LINQ to DataSet simplifies querying by enabling developers to write queries from the programming language itself, instead of by using a separate query language.


There is no automated way to make LinqToSql or the EntityFramework read data from a DataSet instead of from a Database. Using a DataSet as some kind of "disconnected database" is fine for a single UnitOfWork, if you want to use it as some kind of datastore in disconnected scenarios you should consider another solution such as SQL Server CE (which you can't use with L2S but with EF).

If your scenario resembles the first one (single Unit of Work) you need to fill the data manually into the dataset and can then use Linq-To-DataSet consecutively.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜