DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Sun, 12 Aug 2007 21:41:22 +0100,    posted on: microsoft.public.dotnet.framework.windowsforms.databinding        back       

Thread Index
  1    Nick Locke


Generic TableAdapter updates   
Hello,

I understand why it is difficult to use TableAdapters generically (ie they 
really only exist in the mind of the Code Generator!)......

I have an ancestor UserControl from which I inherit many concrete 
UserControls.  Each of those concrete controls has a number of TableAdapter 
and DataSet combinations.  At the moment, my save logic is along the lines 
of:

ta1.Update(ds1.sometable)
ta2.Update(ds1.someothertable)

I would really like to encapsulate the update logic in the ancestor class, 
so that my concrete classes could say something along the lines of:

DoSave(ta1, ds1.sometable)
DoSave(ta2, ds1.someothertable)

Then, the ancestor can include some Try Catch logic and so on to make it all 
more robust - but without needing to repeat the same boilerplate code over 
and over in the concrete classes.  I have read various things about changing 
the base class of the TableAdapter and about using partial classes.  How 
have others done this?

Better still would be if my concrete class could just say:

DoSave()

and leave it up to the ancestor to find all the TableAdapters and update 
them all.  I don't think this is really viable, as there is nothing to tie 
the TableAdapters to specific DataTables.

Clues welcome, thanks.

Nick
Date:Sun, 12 Aug 2007 21:41:22 +0100   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us