M
mohanaranga
Hi All,
I want to update the values into database.And i get these values
from a xml file.I have done the coding for that but its not getting
updated.Plz tell me whats wrong in my program.if possible provide me
some code for this......
DataSet XMLDataSet = new DataSet();
DataSet SqlDataSet = new DataSet();
DataTable XMLTable= new DataTable();
DataTable SQLTable= new DataTable();
SqlConnection Conn = new SqlConnection("Data source = RPriya; Initial
Catalog = Master; UID = sa; PWD = ");
SqlDataAdapter DataAdapt = new SqlDataAdapter();
DataAdapt.SelectCommand = new SqlCommand("Select * from persondetails",
Conn);
SqlCommandBuilder CommandBuild = new SqlCommandBuilder(DataAdapt);
Conn.Open();
XMLDataSet.ReadXml("d:\\myXmlDocument1.xml");
XMLTable= XMLDataSet.Tables[0];
XMLTable.TableName="persondetails";
DataAdapt.Fill(SqlDataSet, "persondetails");
SQLTable=SqlDataSet.Tables["persondetails"];
SQLTable=XMLTable.Copy();
DataAdapt.Update(SqlDataSet,"persondetails");
Conn.Close();
with regards,
Mohan
I want to update the values into database.And i get these values
from a xml file.I have done the coding for that but its not getting
updated.Plz tell me whats wrong in my program.if possible provide me
some code for this......
DataSet XMLDataSet = new DataSet();
DataSet SqlDataSet = new DataSet();
DataTable XMLTable= new DataTable();
DataTable SQLTable= new DataTable();
SqlConnection Conn = new SqlConnection("Data source = RPriya; Initial
Catalog = Master; UID = sa; PWD = ");
SqlDataAdapter DataAdapt = new SqlDataAdapter();
DataAdapt.SelectCommand = new SqlCommand("Select * from persondetails",
Conn);
SqlCommandBuilder CommandBuild = new SqlCommandBuilder(DataAdapt);
Conn.Open();
XMLDataSet.ReadXml("d:\\myXmlDocument1.xml");
XMLTable= XMLDataSet.Tables[0];
XMLTable.TableName="persondetails";
DataAdapt.Fill(SqlDataSet, "persondetails");
SQLTable=SqlDataSet.Tables["persondetails"];
SQLTable=XMLTable.Copy();
DataAdapt.Update(SqlDataSet,"persondetails");
Conn.Close();
with regards,
Mohan