473,659 Members | 3,277 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

get TableAdapters command at run-time ?

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
Sep 27 '06 #1
1 1723
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
Sep 27 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1144
by: Pankaj Banga | last post by:
How can I use Transactions with multiple TableAdapters? Thanks
3
4258
by: Christopher Kimbell | last post by:
I have a class library that contains a number of TableAdapters and I'm using this from a web application. Is there a way of getting the TableAdapters to use the connectionstrings defined in web.config. From the MSDN documentation it seems like it's possible to override settings with values in a config file for winform applications. Is the same possible for web applications. I have tried to add a connectionstring (under the...
3
1799
by: dbuchanan | last post by:
Hello, How do I create a Parent-Child relationship between two DataGridView in a form using TableAdapters. The two tables already have a relationship defined in the dataset. What event do I use to update the child dgv? The RowEnter event? Thank you, dbuchanan
7
1385
by: CMM | last post by:
Unless someone has come up with a way, I still don't understand how you can use TableAdapters in a true n-tier infrastructure.... where the DataAccessLayer is in one Dll and *only* the Datasets themselves can be shared across layers. I find it inconceivable that this suggestion http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=d2907b53-885b-4d24-bc9c-1a04d76036e4 (that's not me who suggested it) has been marked...
0
1571
by: DG | last post by:
I have two SqlTableAdapters (for typed dataset, generated by VS) and want to do update of tables. In transaction of course. How to do it? i try: SqlConnection conn = new SqlConnection(Global.ConnectionString);
0
985
by: rswafford | last post by:
Hi, I am beginning to rewrite an application in ASP.NET 2.0, and I want to utilize strongly typed TableAdapters for my data access layer. However the database that gets queried is not known until the user is logged in -- each client using this application has their own database on my company's server. I know that the SqlConnection object in C# has a ChangeDatabase() method that allows you to specify what database to connect to at...
4
2517
by: Ted Ngo | last post by:
I create a northwind Strongly Typed TableAdapters dataset, the create a query like "select a, b, c, d from employeetable" then bind it into the gridview dim t as new northwindTableAdapters gridview1.datasource = t.getdata() gridview1.databind() Now I create new query in the TableAdapters dataset
1
1845
by: Brett Romero | last post by:
I store my server and database names in a static class that all libraries use. Using a config file, I can switch from test, staging, or production servers easily. I like what TableAdapters are generated by VS.NET 2005 do. It seems most everything is there for you. However, because the TableAdapter controls everything, I'll have to go to each and change the connection string when I want to switch servers. Or, am I missing something? ...
0
1259
by: DG | last post by:
How to update TableAdapters using tranasactions? is this a good sample? http://www.mybug.bloger.hr/post/tableadapters-and-transactions/179426.aspx
4
3590
by: Max2006 | last post by:
Hi, I saw the Business Logic Layer pattern suggested at the following link and I found that the pattern never closes the connection: http://www.asp.net/learn/dataaccess/tutorial02cs.aspx?tabid=63 I am using strongly typed datasets and TableadApters. I assume that TableadApters always closes the connections automatically. Is that correct assumption?
0
8851
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8748
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8628
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6181
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5650
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1978
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1739
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.