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");
==============================================================================
private void WriteXmlToFile(DataSet thisDataSet)    thisDataSet.WriteXml(myXmlWriter);   
   myXmlWriter.Close();
}

相关文章:

  • 2021-11-10
  • 2022-12-23
  • 2021-12-23
  • 2021-08-03
  • 2021-04-06
  • 2022-01-07
  • 2021-09-24
猜你喜欢
  • 2021-05-19
  • 2021-05-16
  • 2021-06-29
  • 2022-02-08
  • 2022-12-23
  • 2021-06-22
相关资源
相似解决方案