HighTechTalks DotNet Forums  

TableAdapter's TableMappings?

Dotnet Framework (ADO.net) microsoft.public.dotnet.framework.adonet


Discuss TableAdapter's TableMappings? in the Dotnet Framework (ADO.net) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Dick
 
Posts: n/a

Default TableAdapter's TableMappings? - 01-16-2006 , 01:00 PM






I like the new TableAdapter in .net 2005 but is there a designer-based
mechanism that populates a DataSet's multiple DataTables from a stored
procedure that returns multiple result sets. i.e. to configure the equivilant
of a DataAdapter's TableMappings?

Reply With Quote
  #2  
Old   
AT
 
Posts: n/a

Default RE: TableAdapter's TableMappings? - 01-16-2006 , 10:18 PM






Hi Richard,

The TableAdapter is a table based DataAdapter, which can only populate 1
DataTable data. If you need to configure the column mapping in the
TableAdapter in the DataSet designer, you can simply change the column
name. The columnn mapping code will be generated automatically. HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."


Reply With Quote
  #3  
Old   
Dick
 
Posts: n/a

Default RE: TableAdapter's TableMappings? - 01-17-2006 , 08:22 PM



Thanks for your replay but it doesn't quite address my problem.

My dataset's typically have multiple tables in them, Order and Order Item
for instance. Populating them in 2003 was relatively easy but required a bit
of code to setup the connection, the command, the data adapter, the table
mappings, etc. A single call is then made to the DB which returns multiple
rowsets which (via the table mappings) populate the dataset's multiple data
tables. But I'm sure you know all this.

I very much like the new features in 2005 and have already identified how we
could refactor parts of our existing applications with a significant
reduction in code in favour of declarative-based development. But this does
somewhat rely upon being able to populate multiple-table datasets via a
single call to the database. But I can't see how to do this. Any ideas?



"Kevin Yu [MSFT]" wrote:

Quote:
Hi Richard,

The TableAdapter is a table based DataAdapter, which can only populate 1
DataTable data. If you need to configure the column mapping in the
TableAdapter in the DataSet designer, you can simply change the column
name. The columnn mapping code will be generated automatically. HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."



Reply With Quote
  #4  
Old   
AT
 
Posts: n/a

Default RE: TableAdapter's TableMappings? - 01-17-2006 , 10:16 PM



Hi Richard,

Sorry, but I'm a little confused. Are you using a DataAdapter to fill data
or a TableAdapter to fill data? A TableAdapter cannot return multiple
result sets. Only the first one will be returned.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."


Reply With Quote
  #5  
Old   
Dick
 
Posts: n/a

Default RE: TableAdapter's TableMappings? - 01-18-2006 , 05:10 AM



I'm sorry to confuse.

My point is, I really like the new TableAdapter and its code-free
declarative method of configuration. But as far as I can see, it is only
useful when the DataSet contains just a single DataTable (or if you are happy
to populate the DataSet via multiple calls to the database - one for each
DataTable).

I can't believe Microsoft would go to the effort to provide the code-free
declarative TableAdapter and not provide a similar code-free declarative
mechanism to populate a DataSet that has multiple DataTables - especially as
the only additional facility would be a collection of TableMappings.

But I can't see how to do this.

"Kevin Yu [MSFT]" wrote:

Quote:
Hi Richard,

Sorry, but I'm a little confused. Are you using a DataAdapter to fill data
or a TableAdapter to fill data? A TableAdapter cannot return multiple
result sets. Only the first one will be returned.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."



Reply With Quote
  #6  
Old   
AT
 
Posts: n/a

Default RE: TableAdapter's TableMappings? - 01-18-2006 , 10:44 PM



Hi Richard,

As you know, the TableAdapter will only fill data to one DataTable. To fill
multi-table DataSet at once, you still have to use the DataAdapter. If you
drag and drop a DataAdapter to the designer, you can also use the designer
to set TableMappings. However, TableAdapter cannot achieve that since it's
single table based, which is by design.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."


Reply With Quote
  #7  
Old   
Dick
 
Posts: n/a

Default RE: TableAdapter's TableMappings? - 01-20-2006 , 04:36 AM



You say "drag and drop a DataAdapter to the designer". How do you do this. My
toolbox only has a TableAdapter (and a Query, a DataTable and a Relation).

"Kevin Yu [MSFT]" wrote:

Quote:
Hi Richard,

As you know, the TableAdapter will only fill data to one DataTable. To fill
multi-table DataSet at once, you still have to use the DataAdapter. If you
drag and drop a DataAdapter to the designer, you can also use the designer
to set TableMappings. However, TableAdapter cannot achieve that since it's
single table based, which is by design.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."



Reply With Quote
  #8  
Old   
William \(Bill\) Vaughn
 
Posts: n/a

Default Re: TableAdapter's TableMappings? - 01-21-2006 , 01:20 PM



When you use the Data Source Configuration wizard (DSCW) to create a
strongly typed DataTable (exposed as a "TableAdapter"), you can drag from
the Data Sources window to a Form design surface--not from the Toolbox.

hth

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________

"Dick" <Richard.Giles (AT) nospam (DOT) nospam> wrote

Quote:
You say "drag and drop a DataAdapter to the designer". How do you do this.
My
toolbox only has a TableAdapter (and a Query, a DataTable and a Relation).

"Kevin Yu [MSFT]" wrote:

Hi Richard,

As you know, the TableAdapter will only fill data to one DataTable. To
fill
multi-table DataSet at once, you still have to use the DataAdapter. If
you
drag and drop a DataAdapter to the designer, you can also use the
designer
to set TableMappings. However, TableAdapter cannot achieve that since
it's
single table based, which is by design.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."





Reply With Quote
  #9  
Old   
Dick
 
Posts: n/a

Default Re: TableAdapter's TableMappings? - 01-23-2006 , 05:33 AM



Thanks for trying to help but that's not nearly what I'm trying to do.

My original post said something like "the new TableAdapter and the
declarative way to configure it using the designer is excelent, but what
about DataSets with more than one DataTable, i.e. why do these improvements
not include a way to configure the TableMappings that allow a single stored
procedure to return multiple rowsets which populate multiple DataTables"?

Kevin Yu's response said "you can drag and drop a DataAdapter to the
designer then use it to configure the TableMappings". But I can't work out
how to do this!

"William (Bill) Vaughn" wrote:

Quote:
When you use the Data Source Configuration wizard (DSCW) to create a
strongly typed DataTable (exposed as a "TableAdapter"), you can drag from
the Data Sources window to a Form design surface--not from the Toolbox.

hth

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________

"Dick" <Richard.Giles (AT) nospam (DOT) nospam> wrote in message
news:1A8E9F42-FFA5-4A97-9757-3DEFAB5EDD14 (AT) microsoft (DOT) com...
You say "drag and drop a DataAdapter to the designer". How do you do this.
My
toolbox only has a TableAdapter (and a Query, a DataTable and a Relation).

"Kevin Yu [MSFT]" wrote:

Hi Richard,

As you know, the TableAdapter will only fill data to one DataTable. To
fill
multi-table DataSet at once, you still have to use the DataAdapter. If
you
drag and drop a DataAdapter to the designer, you can also use the
designer
to set TableMappings. However, TableAdapter cannot achieve that since
it's
single table based, which is by design.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."






Reply With Quote
  #10  
Old   
AT
 
Posts: n/a

Default Re: TableAdapter's TableMappings? - 01-23-2006 , 06:30 AM



Hi Richard,

The DataAdapter is not available in the DataSet's designer. It's available
in the form designer. You can find it in the Data section. If it doesn't
appear there, you can choose from the Choose Items... popup menu.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.