开发者

Entity Framework with text files (no database!)

开发者 https://www.devze.com 2023-03-26 02:52 出处:网络
I\'m used to Forms and DataSets but now I\'m trying out WPF and the Entity Framework. My goal is to fill a DataGrid in WPF with the use of the Entity Framework. However, I do NOT have开发者_如何学编程

I'm used to Forms and DataSets but now I'm trying out WPF and the Entity Framework. My goal is to fill a DataGrid in WPF with the use of the Entity Framework. However, I do NOT have开发者_如何学编程 a database! I have simple text files with data that I have to parse to fill my Entities.

However, I get errors like "Entity type 'TableName' is not mapped." and crashes like that I don't have a connection string.

Is it possible to use the Entity Framework without a database? Or do I have to go back to use a DataSet?


Interesting idea. Microsoft's quite enthusiastic that in theory you can write an EF provider that maps to any kind of data store. I've not got experience with one that maps to a text file, but this link suggests that someone's done it with CSV(!): http://social.msdn.microsoft.com/Forums/ar-SA/adodotnetentityframework/thread/a0e9e20f-66d2-447c-8b7e-75de18535e63?persist=True

If you're stuck with using text files though, why not try LINQ to XML?

And: Entity Framework with XML Files

0

精彩评论

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