DataGridView empty after update of database -
02-14-2006
, 03:26 AM
I'm using VS2005, WinXP, and SQL2005.
My application edits a row in a DataGridView, when a button is pressed
the DB is updated. This is what I do
private void buttonOptShowUpdateDB_Click(object sender,
EventArgs e)
{
try
{
using(TransactionScope ts = new TransactionScope())
{
t_ProductVariantsTableAdapter.Update
(LicDBDataSet.T_ProductVariants);
// Commit the transaction
ts.Complete();
LicDBDataSet.AcceptChanges();
}
}
catch(Exception ex)
{
Debug.WriteLine("OptShow DB Update ERROR !!");
Debug.WriteLine(ex.ToString());
}
}
When the update button is pressed the DB is updated correct, but my
DataGridView becomes empty (I.e. no rows visible). The DataGridView is
present on a tabbed form, and if I change from the current active tab
and back I could see the modified data.
Obviously there is a call that is missing but which one????
--
Regards
Ole Asbjorn Fadum
Scanmar AS |