0
我们怎样才能将ObserableCollection<collectionName>
转换为C#中的XML文件?& WPF?如何将ObservableCollection从C#转换为XML文件?
我们怎样才能将ObserableCollection<collectionName>
转换为C#中的XML文件?& WPF?如何将ObservableCollection从C#转换为XML文件?
使用此代码购买,我很容易将收集转换为XML文件。
static private DataTable ResultsData = new DataTable();
ResultsData = obserableCollectionName().ToDataTable();
System.IO.StringWriter writer = new System.IO.StringWriter();
ResultsData.WriteXml(writer, XmlWriteMode.WriteSchema, false);
string result = writer.ToString();
编辑问题只发生,没有答案出现? –