By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,315 Members | 1,736 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,315 IT Pros & Developers. It's quick & easy.

ADO.NET 2.0 TableAdapter Configuration Wizard

P: n/a
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
Jan 25 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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.
__________________________________

"Mike" <none> wrote in message news:Ou*************@TK2MSFTNGP09.phx.gbl...
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

Jan 25 '06 #2

P: n/a
"William (Bill) Vaughn" <bi**************@nwlink.com> wrote in message
news:uN*************@TK2MSFTNGP11.phx.gbl...
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
Jan 25 '06 #3

P: n/a
Check out the article "New DataSet Features in Visual Studio 2005" at
http://msdn.microsoft.com/vbasic/def...wdtastvs05.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.
"Mike" wrote:
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

Jan 26 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.