HighTechTalks DotNet Forums  

DataGridView empty after update of database

Dotnet Data Tools microsoft.public.dotnet.datatools


Discuss DataGridView empty after update of database in the Dotnet Data Tools forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Ansatt
 
Posts: n/a

Default 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

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.