【发布时间】:2025-12-11 15:55:02
【问题描述】:
我有一个要求
- 将数据库查询中的数据源保存到内存中,以便循环 通过并更新内存中的一些项目。
- 我还需要能够将项目保存在内存中(根据上面第 1 项的结果)
到硬盘上的
xml文件。 - 最后我需要能够将
xml文件加载到内存中。
谁能指出最简单的方法。这一切都在 Windows 服务中完成。
FAItemsUnderControl fItemsUnderControl = new FAItemsUnderControl(ConfigurationManager.AppSettings["DatabaseConnectionString"]);
//Note the line below is for binding to a gridview which is incorrect in my requirement but illustrates the idea
GridViewItemsUnderControlReport.DataSource = fItemsUnderControl.getItemsUnderControl("systemidtbd", "ALL");
【问题讨论】:
-
1.
fItemsUnderControl已经在内存中,2和3可以用System.Xml.Serialization -
我试图将结果映射到对象列表,但它不起作用。
标签: c# xml database service datasource