D
Darryn Ross
Hi,
How do you update data that's been changed in a data grid column back to the
database? i am loading my datagrid as follows....
try {
BatchLstDs.Clear() ;
BatchLstConnection.ConnectionString = AppMain.CompanyConnectionPath ;
BatchLstConnection.Open() ;
//Establishing the database connection and loading the datagrid
SelectLstCommand.CommandText = "SELECT * FROM tblGLBatch ORDER BY " +
pOrderBy ;
SelectLstCommand.Connection = BatchLstConnection ;
BatchLstAdapter.SelectCommand = SelectLstCommand ;
BatchLstAdapter.MissingSchemaAction = MissingSchemaAction.AddWithKey ;
BatchLstAdapter.Fill(BatchLstDs, "tblGLBatch") ;
dgGLBatch.SetDataBinding(BatchLstDs, "tblGLBatch") ;
}
catch (Exception e) {
MessageBox.Show(e.Message, "PopulateDataGrid", MessageBoxButtons.OK,
MessageBoxIcon.Error) ;
}
finally {
BatchLstConnection.Close() ;
}
Regards
Darryn
How do you update data that's been changed in a data grid column back to the
database? i am loading my datagrid as follows....
try {
BatchLstDs.Clear() ;
BatchLstConnection.ConnectionString = AppMain.CompanyConnectionPath ;
BatchLstConnection.Open() ;
//Establishing the database connection and loading the datagrid
SelectLstCommand.CommandText = "SELECT * FROM tblGLBatch ORDER BY " +
pOrderBy ;
SelectLstCommand.Connection = BatchLstConnection ;
BatchLstAdapter.SelectCommand = SelectLstCommand ;
BatchLstAdapter.MissingSchemaAction = MissingSchemaAction.AddWithKey ;
BatchLstAdapter.Fill(BatchLstDs, "tblGLBatch") ;
dgGLBatch.SetDataBinding(BatchLstDs, "tblGLBatch") ;
}
catch (Exception e) {
MessageBox.Show(e.Message, "PopulateDataGrid", MessageBoxButtons.OK,
MessageBoxIcon.Error) ;
}
finally {
BatchLstConnection.Close() ;
}
Regards
Darryn