Dynamically calling a TableAdapter's Update method

R

Ron

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
 
A

AdamH

well if TableAdapterCollection would be
List<TableAdapter> TableAdapterCollection.... then
foreach(TableAdapter ta in TableAdapterCollection){
ta.update(...) // shoudl work
}

( i think )
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top