469,883 Members | 1,219 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,883 developers. It's quick & easy.

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 1410
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Ahmet Karaca | last post: by
2 posts views Thread by Bennett Haselton | last post: by
1 post views Thread by Nikolay Petrov | last post: by
1 post views Thread by Peter Newman | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.