我想在我的ASP.net中,将DataSet转换成xml文件,或者将xml转换成DataSet。
我现在只做了一个将DataSet转换成xml的程序,但却看不到数据,在.net环境
中打开只能看到"xml","数据"属性中什么也没有,点击“数据”属性页,提示
要查看数据,xml源中要有数据。
查看“xml”属性页,发现,每条记录都转换成了"table1","table2"标签,请问
这是怎么回事?怎样成功的实现它们之间的转换呢?
我的代码如下:DataSet ds=new DataSet();
da.Fill(ds);
DataGrid1.DataSource=ds;
DataGrid1.DataBind();
cn.Close();
cn.Dispose();
ds.WriteXml("c:\\userinfo.xml",System.Data.XmlWriteMode.DiffGram);