Hi Guys,
While i managed to add rows and save them in the grid. I want to know the syntax for Update the data in the grid directly.
Thanks
Sai
private void btnUpdate_Click(object sender, EventArgs e)
{
string col2 = dg[1, dg.CurrentCell.RowIndex].Selected.ToString();
string col3 = dg[2, dg.CurrentCell.RowIndex].Value.ToString();
string col4 = dg[3, dg.CurrentCell.RowIndex].Value.ToString();
string col5 = dg[4, dg.CurrentCell.RowIndex].Value.ToString();
string col6 = dg[5, dg.CurrentCell.RowIndex].Value.ToString();
string col7 = dg[6, dg.CurrentCell.RowIndex].Value.ToString();
string col8 = dg[7, dg.CurrentCell.RowIndex].Value.ToString();
string col9 = dg[8, dg.CurrentCell.RowIndex].Value.ToString();
string update_sql = "UPDATE Customers SET Last_Name ='" col2 "'",Type_Of_Trip ='" col3 "', Leaving_From ='" col4 "', Going_To ='" col5 "',Departing_Date ='"col6 "', Returning_Date ='" col7 "', Departing_Time ='" col8 "',Returning_Time ='"col9 "'; // Is this the correct syntax?
this.getcom(update_sql);
}