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