private void dataGridView1_CellValueChanged(object sender, DataGridViewCellEventArgs e)
{
try
{
string mystr1 = this.dataGridView1.Columns[e.ColumnIndex].HeaderText+"="+"'"+dataGridView1.CurrentCell.Value.ToString()+"'";
string mystr2 = dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString();
string updataSql = "update [user] set "+mystr1+" where id ="+mystr2;
adapter = new SqlDataAdapter(updataSql,conn);
adapter.Fill(ds);
loadData();
fenyeLoad();
}
catch (Exception ex)
{
throw;
}
}
private void loadData() {
string selectSql = "select * from [user]";
adapter = new SqlDataAdapter(selectSql,conn);
adapter.Fill(ds);
}