472,993 Members | 2,544 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,993 software developers and data experts.

How to identify the tables in a dataAdapter?

I have a class method that returns a DataAdapter. I want to access the
table(s) contained in the DataAdapter. Of course, accessing the DataSets
would be good enough, because I could get the tables from there. I can't
find a way to do this. Am I missing something?

Much obliged.
Nov 20 '05 #1
6 1540
Hi Geoff,

Datasdapters don't have tables - they are device to pass data into a
dataset.

You can get the tables inside a dataset with
For Each tb In Me.Petailerds1.Tables

MessageBox.Show(tb.TableName)

Next

HTH,

Bernie Yaeger

"Geoff Pennington" <pe*********@stic2.com.NO!SPAM!> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I have a class method that returns a DataAdapter. I want to access the
table(s) contained in the DataAdapter. Of course, accessing the DataSets
would be good enough, because I could get the tables from there. I can't
find a way to do this. Am I missing something?

Much obliged.

Nov 20 '05 #2
Hi Bernie -
Sorry, that doesn't help. Looks like what I want to do can't be done.

I want to apply a bunch of insert/update/delete to a table and then use the
DataAdapter.Update method to apply the updates all at once. I have a
business class that should return the DataAdapter to the application; the
application will apply the updates to the table; then the application
returns the DataAdapter to another method in the business class, which calls
the DataAdapter.Update method. But apparently this just won't work, because
the returned DataAdapter has no idea what tables were "filled" into what
datasets. One solution would be to ditch the business class and do
everything in the application, but I'm trying to be more object oriented
than that.

But maybe it doesn't matter anyway. There are other reasons why the Update
method doesn't work so well for my app. Thanks for trying.

Geoff.

"Bernie Yaeger" <be*****@cherwellinc.com> wrote in message
news:Ox**************@tk2msftngp13.phx.gbl...
Hi Geoff,

Datasdapters don't have tables - they are device to pass data into a
dataset.

You can get the tables inside a dataset with
For Each tb In Me.Petailerds1.Tables

MessageBox.Show(tb.TableName)

Next

HTH,

Bernie Yaeger

"Geoff Pennington" <pe*********@stic2.com.NO!SPAM!> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I have a class method that returns a DataAdapter. I want to access the
table(s) contained in the DataAdapter. Of course, accessing the DataSets
would be good enough, because I could get the tables from there. I can't
find a way to do this. Am I missing something?

Much obliged.


Nov 20 '05 #3
EMW
what about: dataset1.tables(0).....

rg,
Eric


"Geoff Pennington" <pe*********@stic2.com.NO!SPAM!> schreef in bericht
news:uW**************@TK2MSFTNGP09.phx.gbl...
Hi Bernie -
Sorry, that doesn't help. Looks like what I want to do can't be done.

I want to apply a bunch of insert/update/delete to a table and then use the DataAdapter.Update method to apply the updates all at once. I have a
business class that should return the DataAdapter to the application; the
application will apply the updates to the table; then the application
returns the DataAdapter to another method in the business class, which calls the DataAdapter.Update method. But apparently this just won't work, because the returned DataAdapter has no idea what tables were "filled" into what
datasets. One solution would be to ditch the business class and do
everything in the application, but I'm trying to be more object oriented
than that.

But maybe it doesn't matter anyway. There are other reasons why the Update
method doesn't work so well for my app. Thanks for trying.

Geoff.

"Bernie Yaeger" <be*****@cherwellinc.com> wrote in message
news:Ox**************@tk2msftngp13.phx.gbl...
Hi Geoff,

Datasdapters don't have tables - they are device to pass data into a
dataset.

You can get the tables inside a dataset with
For Each tb In Me.Petailerds1.Tables

MessageBox.Show(tb.TableName)

Next

HTH,

Bernie Yaeger

"Geoff Pennington" <pe*********@stic2.com.NO!SPAM!> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I have a class method that returns a DataAdapter. I want to access the
table(s) contained in the DataAdapter. Of course, accessing the DataSets would be good enough, because I could get the tables from there. I can't find a way to do this. Am I missing something?

Much obliged.



Nov 20 '05 #4
Same problem. If I am passing around a dataAdapter, how do I get to the
datasets? The DataAdapter does not actually have a dataset collection; so my
idea of passing around the DataAdapter and getting from it either then
tables or datasets just won't work. Apparently.

"EMW" <so*****@microsoft.com> wrote in message
news:3f**********************@dreader2.news.tiscal i.nl...
what about: dataset1.tables(0).....

rg,
Eric


"Geoff Pennington" <pe*********@stic2.com.NO!SPAM!> schreef in bericht
news:uW**************@TK2MSFTNGP09.phx.gbl...
Hi Bernie -
Sorry, that doesn't help. Looks like what I want to do can't be done.

I want to apply a bunch of insert/update/delete to a table and then use

the
DataAdapter.Update method to apply the updates all at once. I have a
business class that should return the DataAdapter to the application; the
application will apply the updates to the table; then the application
returns the DataAdapter to another method in the business class, which

calls
the DataAdapter.Update method. But apparently this just won't work,

because
the returned DataAdapter has no idea what tables were "filled" into what
datasets. One solution would be to ditch the business class and do
everything in the application, but I'm trying to be more object oriented
than that.

But maybe it doesn't matter anyway. There are other reasons why the Update method doesn't work so well for my app. Thanks for trying.

Geoff.

"Bernie Yaeger" <be*****@cherwellinc.com> wrote in message
news:Ox**************@tk2msftngp13.phx.gbl...
Hi Geoff,

Datasdapters don't have tables - they are device to pass data into a
dataset.

You can get the tables inside a dataset with
For Each tb In Me.Petailerds1.Tables

MessageBox.Show(tb.TableName)

Next

HTH,

Bernie Yaeger

"Geoff Pennington" <pe*********@stic2.com.NO!SPAM!> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
> I have a class method that returns a DataAdapter. I want to access the > table(s) contained in the DataAdapter. Of course, accessing the

DataSets > would be good enough, because I could get the tables from there. I can't > find a way to do this. Am I missing something?
>
> Much obliged.
>
>



Nov 20 '05 #5
Hi Geoff,

You could create a globals class that has an array or arraylist in it.
Increment that array with the name of the dataset each time you use the
dataadapter fill method. Then, when you want to know the datasets filled by
that dataadapter, you have it in the array.

HTH,

Bernie

"Geoff Pennington" <pe*********@stic2.com.NO!SPAM!> wrote in message
news:uW**************@TK2MSFTNGP09.phx.gbl...
Hi Bernie -
Sorry, that doesn't help. Looks like what I want to do can't be done.

I want to apply a bunch of insert/update/delete to a table and then use the DataAdapter.Update method to apply the updates all at once. I have a
business class that should return the DataAdapter to the application; the
application will apply the updates to the table; then the application
returns the DataAdapter to another method in the business class, which calls the DataAdapter.Update method. But apparently this just won't work, because the returned DataAdapter has no idea what tables were "filled" into what
datasets. One solution would be to ditch the business class and do
everything in the application, but I'm trying to be more object oriented
than that.

But maybe it doesn't matter anyway. There are other reasons why the Update
method doesn't work so well for my app. Thanks for trying.

Geoff.

"Bernie Yaeger" <be*****@cherwellinc.com> wrote in message
news:Ox**************@tk2msftngp13.phx.gbl...
Hi Geoff,

Datasdapters don't have tables - they are device to pass data into a
dataset.

You can get the tables inside a dataset with
For Each tb In Me.Petailerds1.Tables

MessageBox.Show(tb.TableName)

Next

HTH,

Bernie Yaeger

"Geoff Pennington" <pe*********@stic2.com.NO!SPAM!> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I have a class method that returns a DataAdapter. I want to access the
table(s) contained in the DataAdapter. Of course, accessing the DataSets would be good enough, because I could get the tables from there. I can't find a way to do this. Am I missing something?

Much obliged.



Nov 20 '05 #6
OK, that should work. Thanks.

"Bernie Yaeger" <be*****@cherwellinc.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hi Geoff,

You could create a globals class that has an array or arraylist in it.
Increment that array with the name of the dataset each time you use the
dataadapter fill method. Then, when you want to know the datasets filled by that dataadapter, you have it in the array.

HTH,

Bernie

"Geoff Pennington" <pe*********@stic2.com.NO!SPAM!> wrote in message
news:uW**************@TK2MSFTNGP09.phx.gbl...
Hi Bernie -
Sorry, that doesn't help. Looks like what I want to do can't be done.

I want to apply a bunch of insert/update/delete to a table and then use

the
DataAdapter.Update method to apply the updates all at once. I have a
business class that should return the DataAdapter to the application; the
application will apply the updates to the table; then the application
returns the DataAdapter to another method in the business class, which

calls
the DataAdapter.Update method. But apparently this just won't work,

because
the returned DataAdapter has no idea what tables were "filled" into what
datasets. One solution would be to ditch the business class and do
everything in the application, but I'm trying to be more object oriented
than that.

But maybe it doesn't matter anyway. There are other reasons why the Update method doesn't work so well for my app. Thanks for trying.

Geoff.

"Bernie Yaeger" <be*****@cherwellinc.com> wrote in message
news:Ox**************@tk2msftngp13.phx.gbl...
Hi Geoff,

Datasdapters don't have tables - they are device to pass data into a
dataset.

You can get the tables inside a dataset with
For Each tb In Me.Petailerds1.Tables

MessageBox.Show(tb.TableName)

Next

HTH,

Bernie Yaeger

"Geoff Pennington" <pe*********@stic2.com.NO!SPAM!> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
> I have a class method that returns a DataAdapter. I want to access the > table(s) contained in the DataAdapter. Of course, accessing the

DataSets > would be good enough, because I could get the tables from there. I can't > find a way to do this. Am I missing something?
>
> Much obliged.
>
>



Nov 20 '05 #7

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

Similar topics

1
by: Ahmet Karaca | last post by:
Hi. myds.Reset(); mycommand.SelectCommand.CommandText= "Select att1 from Ing as Ingredient, Pro as Product "+ "where Pro.ad='apple' and Pro.id=Ing.id"; mycommand.Fill(myds, "Product"); // Here...
2
by: msnews.microsoft.com | last post by:
Current code 1.. creates SqlDataAdapter 2.. fills dataset with database table extracted from dataadapter 3.. populates tables with database table contents extracted from dataadapter 4.. binds...
2
by: Bennett Haselton | last post by:
I know how to create a DataAdapter that loads data from a data source into a table in a typed DataSet, and how to set the DataSource and DataMember properties of a DataGrid so that at run time it...
1
by: Nikolay Petrov | last post by:
How to fill dataset with multiple tables and set their relaition? Can I get the relations from the SQL server? Also I would like to do it using stored procedures. TIA
8
by: Dot Net Newbie | last post by:
New to DOTNET so please be gentle: I have an in-memory dataset that I want move to a SQL Server database. The XML schema with which the dataset was built matches exactly the table schema in SQL...
1
by: Daves | last post by:
a SQL query can return multiple data tables eg SELECT expression1 ... SELECT expression2 ... Can I in ASP.Net utilise this to do fewer data fetches from the server, e.g. selectively binding...
1
by: Peter Newman | last post by:
running vb.net 2003 & SQL 2005 I have the following function that is meant to add a row to a table... but i keep getting an error and i dont understand why. Ive spent a couple of days on this...
7
by: koonda | last post by:
Hi guys, I am trying to create a web interface in C# using ASP.NET. The database being used is SQL Server. I have some problems loading the tables in the datalist controls. When I run the program...
0
by: pieandpeas | last post by:
Hi, I'm having a problem with my code, I am doing the following - retrieving a field from a table, which is linked to another table, i'm only updating one of the fields in one of the two tables......
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

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.