I m developing a Windows Form Application by using C# 2.0 and SQL Server 2005. In my application, I retrieve data by clicking a btnLoadData button from the database into a dataGridview contrl. Code sample to retrieve data:-
private void btnLoadData_Click(object sender, EventArgs e)
string s1 = "select * from Sales_Details";
SqlConnection cn = new SqlConnection(Class1.cs);
SqlDataAdapter da = new SqlDataAdapter(s1, cn);
DataSet ds = new DataSet();
dataGridView1.DataSource = ds.Tables;
I want to update or edit a column of that dataGridview by clicking the column and save it back to the database by using the same ID. But I don't know how to do this, please someone help me.