get TableAdapters command at run-time ?

  • Thread starter Thread starter Wanjun Yu
  • Start date Start date
W

Wanjun Yu

I have multiple tables that have the same structrues that I need to switch
at run-time.

for example, I have table A, B and C, they all have the same structure. At
run-time, the GUI will determin which table I'll be queriying on.

I can build the Datasets and TableAdapters at design time, but I can't seem
to access the (select) commands at run-time. If I do, I can just replace the
talbe name and it shoud query on the table I have specified.

I guess I can use the DataAdapters , get the commands and change them at
run-time. I'm just wondering about the TableAdaters, since that's the
default that Visual Studio 2005 creaets.

Thanks!

WJ
 
Am Wed, 27 Sep 2006 16:01:03 -0500 schrieb Wanjun Yu:

Hello Wanjun,
I have multiple tables that have the same structrues that I need to switch
at run-time.

for example, I have table A, B and C, they all have the same structure. At
run-time, the GUI will determin which table I'll be queriying on.

I can build the Datasets and TableAdapters at design time, but I can't seem
to access the (select) commands at run-time. If I do, I can just replace the
talbe name and it shoud query on the table I have specified.

I guess I can use the DataAdapters , get the commands and change them at
run-time. I'm just wondering about the TableAdaters, since that's the
default that Visual Studio 2005 creaets.

You can add as many select statements as you want to every TableAdapter.
The Visual Studio 2005 IDE supports a wizard for this kind of editing.
Furthermore, it's no problem to extend the Dataset class because Visual
Studio 2005 uses partial classes, so it is very easy to add code riskless
to auto generated classes.

Bye

Frank Loizzi
Dortmund, Germany
 

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

Back
Top