So you are manually using ADO.NET to connect to the database and populate the DataTable and then binding to the DataTable.
The corresponding way to save this then is to have some type of Save option (button or menu option). When the user clicks Save, you again connect to the database and execute an Update SQL statement.
I have similar code here:
http://msmvps.com/blogs/deborahk/archive/2009/08/25/update-a-microsoft-access-database.aspxPasted here:
string update = "Update Customer Set Title = ? Where PersonId = ?";
string cnnString =
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Customer.mdb;";
using (var cnn = new OleDbConnection(cnnString))
{
cnn.Open();
using (var cmd = new OleDbCommand(update, cnn))
{
// Add the parameters
cmd.Parameters.AddWithValue("@Title", "President");
cmd.Parameters.AddWithValue("@PersonId", 1);
// Execute the command
cmd.ExecuteNonQuery();
}
}
You will have to change the Update statement to update Supply and set the appropriate parameters.
Hope this helps.
www.insteptech.com ;
msmvps.com/blogs/deborahk
We are volunteers and ask only that if we are able to help you, that you mark our reply as your answer. THANKS!