Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
DotNet
acad.assignment.mngr
academic
adonet
aspnet
aspnet.announcements
aspnet.build.controls
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
clr
compactframework
component_services
datatools
distributed_apps
drawing
faqs
framework
framework.wmi
general
internationalization
interop
languages.csharp
languages.jscript
languages.vb
languages.vb.controls
languages.vb.data
languages.vb.upgrade
languages.vc
languages.vc.libraries
myservices
odbcnet
performance
remoting
scripting
sdk
security
setup
vjsharp
vsa
webservi.enhancements
webservices
windowsforms
windowsforms.controls
winforms.databinding
winforms.designtime
xml
  
 
date: Tue, 14 Feb 2006 09:26:01 +0100,    group: microsoft.public.dotnet.datatools        back       


DataGridView empty after update of database   
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
date: Tue, 14 Feb 2006 09:26:01 +0100   author:   Ansatt

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us