Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / March 2008

Tip: Looking for answers? Try searching our database.

Dynamically calling a TableAdapter's Update method

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ron - 13 Mar 2008 22:32 GMT
Because there is no TableAdapter base class (The designer creates
TableAdapaters as classes which are derived from
global::System.ComponentModel.Component) I need a way to call the Update
method of a series of TableAdapters that are stored in a collection.  The
problem is in order to store TableAdapters in a collection I had to cast
them as Components, but when I retrieve them, obviously they don't have an
update method because the Component class has no Update method:

foreach(Component tableAdapt in TableAdapterCollection)
{
   tableAdapt.Update(...);   <----- This can't happen because the items
stored in the collection are type of Components and can't cast them to
TableAdapters
}

I am really in need of a way to do this...even if it is "creative" :-)

Thanks!
Ron
AdamH - 14 Mar 2008 02:13 GMT
well if TableAdapterCollection would be
List<TableAdapter> TableAdapterCollection.... then
foreach(TableAdapter ta in TableAdapterCollection){
ta.update(...) // shoudl work
}

( i think )

> Because there is no TableAdapter base class (The designer creates
> TableAdapaters as classes which are derived from
[quoted text clipped - 15 lines]
> Thanks!
> Ron

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.