开发者

Working with Database using LINQ to XML

I am Working on a project (C#) in the university and they said that we can't use a DBMS like SQL S开发者_JS百科erver so we decide to use Linq and XML...we learned some basics in Linq to Xml But really we don't know how we can create tables and fields and work with them in Xml.any suggestions ?


The simplest option would be a Typed Dataset saved to an XML file. (With or without LINQ)

You would use it just like an RDBMS, but it isn't an RDMS, so it should be allowed.


If it's a single user application you can just create a serializable class and use that to store your data. Then when your app is closed the data class is serialized (binarily) to a file, and when the app starts it reads the file and all your data is still there.

Here is a simple example from the docs.


If you really want to use tables, you can create a Typed DataSet and Save/Load it as (proprietary) XML.

A DataSet can hold multiple tables + relations between them.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜