I want to write a program to manipulate data in SQL-SERVER.
in my app form , i want to use a datagrid to display & update datas, so i
fill some codes as follows:
private void Run_Click(object sender, System.EventArgs e)
{
if(sqlCon.State == ConnectionState.Open)
sqlCon.Close();
sqlCon.ConnectionString = conLogoin1.ConnectionString;
sqlCon.Open();
SqlDataAdapter sqlDA = new SqlDataAdapter("SELECT * FROM " +
conLogoin1.LTable, sqlCon);
DataSet ds = new DataSet(conLogoin1.LTable);
sqlDA.Fill(ds, conLogoin1.LTable);
dataGrid1.DataSource = ds.Tables[conLogoin1.LTable].DefaultView;
}
but how can i update the data modified in datagrid ?
just like :
private void Update_Click(object sender, System.EventArgs e)
{
//some code to update the data modified in the datagrid
//how can I ?
}
-----------------------------------------------
Thanks for your any comments
Albert Guo
Jiangsu Police Institute ,China PRC