Fail update database from DataGridView
I am working at winforms project and i have a datagridview from which i am trying to update a database from it when the user changes something. Here is the code:
DataSet ds = new DataSet();
SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["EbosPr.Properties.Settings.Database1ConnectionString1"].ConnectionString);
SqlCommand scmd = new SqlCommand("Select * From CustCalls ", conn);
SqlDataAdapter sda = new SqlDataAdapter(scmd);
DataTable dt = ds.Tables;
SqlCommandBuilder myBuilder = new SqlCommandBuilder(sda);
sda.UpdateCommand = myBuilder.GetUpdateCommand();
The above code doesnt update the database. Any idea?
Re: Fail update database from DataGridView
Did you check the below?
Before to your Update command ou have to give
And after to your update command you have to give