hello everyone,
i have a simple form in which there are 1 sqlconnection, some
sqldataadapter and 1 dataset.
During runtime i want to read all sqldataadapter to change all
SqlSelectCommand because my table defined at designtime is "TABLE", but
in runtime is "TABLE1" or "TABLE2", depending of a variable.
Is it possible to do this?
Thanks,
Roberto
Stoitcho Goutsev (100) - 14 Feb 2006 14:33 GMT
Roby,
Unless you add all your dataadapters in a collection there us no way to
iterate them (at least not one that I know). SqlDataAdapter is a componet.
Some disposable components are implemented to go in the components
collection when added in design time, but SqlDataAdapter is not one of them.
The solution is really easy just keep a collection and when you create
dataadapter (or in the form constructor if you add them in design time) add
all the dataadapters to this collection. If you destroy some of them don't
forget to remove it from there.

Signature
HTH
Stoitcho Goutsev (100)
> hello everyone,
> i have a simple form in which there are 1 sqlconnection, some
[quoted text clipped - 7 lines]
>
> Roberto
roby9999@gmail.com - 14 Feb 2006 14:49 GMT
thank you very much Stoicho, your answer was very complete.
I will follow what you said,
Bye!
Roberto