根据数据库生成xml二法[1]

[入库:2006年2月23日] [更新:2007年3月24日]

本文简介:

SqlConnection conn = new SqlConnection();
      conn.ConnectionString 
= "Server=127.0.0.1;User ID=sa;Password=fdahgdrethj31313210212121;Database=northwind;Persist Security Info=True";
      conn.Open();
      SqlDataAdapter da 
= new SqlDataAdapter("select * from 表", conn);
      SqlCommandBuilder thisBulder 
= new SqlCommandBuilder(da);
      DataSet ds 
= new DataSet();
      da.Fill(ds);
      ds.WriteXml(
@"C:\temp.xml");
==============================================================================

本文关键:根据数据库生成xml二法
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top