开发者

LINQ to SQL equivalent for XML file persistence

开发者 https://www.devze.com 2022-12-13 18:28 出处:网络
Microsoft has made saving objects very easy with their LINQ to SQL mapping. However, I would sometimes like something a little more lightweight, i.e. th开发者_开发问答e ability to save objects to a

Microsoft has made saving objects very easy with their LINQ to SQL mapping.

However, I would sometimes like something a little more lightweight, i.e. th开发者_开发问答e ability to save objects to a file when an application closes, and read them back in again. XML seems like a natural data format rather than inventing a new data format. (Of course, one could argue that XML is the new ascii, and we still have the problem of defining the data schema etc. ..).

Is there a predefined method of doing this, or am I going to have to manually figure out an XML data format and write routines to read/write them, i.e. by constructing a DOM equivalent and then saving as XML?


How about working with your data in DataSets and DataTables, etc - then serializing them as XML?

0

精彩评论

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