如何把数据库中的数据保存为XML文件?用实例说明具体的步骤
来源:百度知道 编辑:UC知道 时间:2024/05/18 03:35:36
急等
string path = System.Web.HttpContext.Current.Server.MapPath(".")+"/"+ConfigurationSettings.AppSettings["XmlPath"];//xml的路径,可以配在webconfig中
DataSet resultds = 你的数据源
FileInfo fi = null;
fi=new FileInfo( path);
if(fi.Exists)
{
fi.Delete();
}
resultds.WriteXml(path);