PDA

View Full Version : اعمال تغییرات یک DataTable به پایگاه داده



mahdi bg
سه شنبه 17 دی 1387, 09:55 صبح
سلام
من اگر توی یک DataTable تغییرات رو انجام بدم و بخوام توی پایگاه داده منتقل بشه باید چکار کنم؟

من کار های زیر رو انجام دادم :


OleDbConnection connection;
OleDbDataAdapter dataadaptor;
DataTable datatable;


connection.ConnectionString = ""
dataadaptor.SelectCommand = new OleDbCommand(""");
dataadaptor.SelectCommand.Connection = connection;
connection.Open();
dataadaptor.Fill(datatable);
connection.Close();



DataRow newrow = datatable.NewRow();
newrow[1] = "10";
newrow[2] = "10";
newrow[3] = 10;
datatable.Rows.Add(newrow);


حالا باید چکار کنم تا این تغییر به پایگاه داده منتقل بشه.
ممنون