dataset里的数据是从xml里读取的(其中包括多张表的内容)怎么样才能用这个dataset一次同时更新多张表啊? 小弟我这有一个更新一个表的例子 哪位大哥能帮我改一下 SqlConnection myConnection = new SqlConnection("server=192.168.0.155;database=patientDataBase;uid=sa;pwd=sa");
SqlDataAdapter myCommand = new SqlDataAdapter("select * from patientInfoTable ", myConnection);//是不是就在这句的select语句上做改动啊?
SqlCommandBuilder sqlcommandbuilder = new SqlCommandBuilder(myCommand);
DataSet upLoadXmlDataSet = new DataSet();
upLoadXmlDataSet.ReadXml(@"C:\Inetpub\wwwroot\AboutPdf\XML\Test.xml");
myCommand.Update(upLoadXmlDataSet);
SqlDataAdapter myCommand = new SqlDataAdapter("select * from patientInfoTable ", myConnection);//是不是就在这句的select语句上做改动啊?
SqlCommandBuilder sqlcommandbuilder = new SqlCommandBuilder(myCommand);
DataSet upLoadXmlDataSet = new DataSet();
upLoadXmlDataSet.ReadXml(@"C:\Inetpub\wwwroot\AboutPdf\XML\Test.xml");
myCommand.Update(upLoadXmlDataSet);
SqlDataAdapter myCommand = new SqlDataAdapter("select * from patientInfoTable ", myConnection);//是不是就在这句的select语句上做改动啊?
SqlCommandBuilder sqlcommandbuilder = new SqlCommandBuilder(myCommand);
这两句然后,更新的时候
myCommand.Update(upLoadXmlDataSet.Table[yourTableName]);
http://blog.csdn.net/zhzuo/archive/2004/08/06/67037.aspx