ADO.NET 2.0 TableAdapter Configuration Wizard

M

Mike

Dear Group,

When I add a DataTable to a Typed Dataset, and a TableAdapter to the
DataTable, I am able to create methods to send updates directly to the
database (GenerateDBDirectMethods), however when my TableAdapter Fill SQL
contains a WHERE clause which looks up a field from another joined table,
the Fill works perfectly, but I cannot Insert, Update or Delete using the
TableAdapter.

Does anyone know why this is?

I don't want to return ALL the data and then filter the results, I need to
do this within the WHERE clause.

I'm binding the DataTable to a DataGridView.

Many thanks in advance!

Mike
 
W

William \(Bill\) Vaughn

As we've said many times, the TableAdapter gizmo is designed to work with
ONE table. Not the product of a JOIN. For that you're on your own to create
the action commands.

--
____________________________________
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.
__________________________________
 
M

Mike

William (Bill) Vaughn said:
As we've said many times, the TableAdapter gizmo is designed to work with
ONE table. Not the product of a JOIN. For that you're on your own to
create the action commands.

Thanks William,

To be fair; I did suspect it, but couldn't find any authoritative MSDN
article to suggest that this was the case. Almost all MSDN articles just
don't mention it.

Regards,

Mike
 
G

Guest

Check out the article "New DataSet Features in Visual Studio 2005" at
http://msdn.microsoft.com/vbasic/default.aspx?pull=/library/en-us/dnvs05/html/newdtastvs05.asp

Although a TableAdapter can have multiple Fill commands, there is only one
set of update commands that are executed when the TableAdapter's Update
method is called. These are generated automatically, based on the
TableAdapter's main query. The query that is defined when the TableAdapter is
first created is considered the main query for the TableAdapter. If any
subsequently defined queries return a schema that is different that the main
query's schema, the designer will warn you about it with a message box.
Alternatively, if you modify the schema of the main query, Visual Studio will
go and modify your other queries to match that schema.
 

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

Top