473,385 Members | 1,588 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

ADO.NET 2.0 TableAdapter Configuration Wizard

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
3 7184
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
"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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: GaryDean | last post by:
We have been noticing that questions on vs.2005/2.0 don't appear to get much in answers so I'm reposting some questions posted by some of the programmers here in our organization that never got...
1
by: hecsan07 | last post by:
Hey I am trying to get some practice on VS 2005 TableAdapter Configuration Wizard. I wrote a Database project and include a couple of stored procedures one of which was an insert procedure. The...
0
by: rpuertas | last post by:
Hello, Visual Web Developer 2005 Express Edition and SQL Server 2005 Express: I want to run a paged query within a TableAdapter. In the TableAdapter Query Configuration Wizard" I write the next...
1
by: Demetri | last post by:
I have a question / concern regarding the new suggested way of creating a data access layer in an n-tier application. Typically, a web application specifically, using the SOA (Service Oriented...
0
by: TinMan | last post by:
in my 2.0 ASP.Net app I'm using the TableAdapter Configuration wizard and asking it to generate Selece, Update, Insert, and Delete. It did not generate the delete! Why? Thanks, T
2
by: GaryDean | last post by:
I'm comparing use of DataView -ObjectDataSource -TableAdapter to DataView -SqlDataSource using the Customers table on the NorthWind database. The SQL given to both wizards is: SELECT ...
0
by: =?ISO-8859-2?Q?Marcin_Krzy=BFanowski?= | last post by:
Hi, I noticed strange problem I can't resolve. I use "TableAdapter Configuration Wizard" to configure new table in my XSD but after last step I get error code -1 Last step:...
0
by: M | last post by:
TableAdapter Configuration Wizard do not create Insert Statement(It Creates SELECT, UPDATE, DELETE statements) So if I try using Myadapter.update(MydataTable) to add a new row. I get Error...
3
by: bogdan | last post by:
Hi, I have a stored procedure that returns a single value. Example: SELECT @RowCount = COUNT(*) FROM t WHERE RETURN @RowCount I created a data set, table adapter, and adapter's method...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.