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

TableAdapter Problem

P: n/a
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 CustomerID, CompanyName, ContactName, ContactTitle, Address,
City, Region, PostalCode, Country, Phone, Fax
FROM Customers

But the two wizards generate different UPDATE statements (Pasted below) and
I see the TableAdapter is trying to set the CustomerID Key which looks
wrong. The problem here is that the TableAdapter does not work saying that
it can't fine a generic Update statement with the correct parameters.

Why is the TableAdapter wizard generating bad Update SQL ??

ObjectDataSource:
UPDATE Customers SET CustomerID = @CustomerID, CompanyName =
@CompanyName, ContactName = @ContactName, ContactTitle = @ContactTitle,
Address = @Address, City = @City, Region = @Region, PostalCode =
@PostalCode, Country = @Country, Phone = @Phone, Fax = @Fax
WHERE (CustomerID = @Original_CustomerID)

SqlDataSource:
UPDATE [Customers] SET [CompanyName] = @CompanyName, [ContactName] =
@ContactName, [ContactTitle] = @ContactTitle,
[Address] = @Address, [City] = @City, [Region] = @Region, [PostalCode] =
@PostalCode, [Country] = @Country, [Phone] = @Phone, [Fax] = @Fax
WHERE [CustomerID] = @CustomerID">

--
Regards,
Gary Blakely
Jul 25 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hello Gary,

Thanks for your posting.

Regarding on this issue, I've noticed that you've posted another duplicated
thread

"TableAdapter generates bad SQL" in the following newsgroup:

microsoft.public.dotnet.framework.adonet

Our member Kevin has replied you in that thread and will continue to work
with you there. I'd appreciate if you have a look there, and if you have
any further questions, please feel free to post there.

Thanks for your understanding.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 26 '06 #2

P: n/a
thanks. Working that over there

--
Regards,
Gary Blakely
"Steven Cheng[MSFT]" <st*****@online.microsoft.comwrote in message
news:XY**************@TK2MSFTNGXA01.phx.gbl...
Hello Gary,

Thanks for your posting.

Regarding on this issue, I've noticed that you've posted another
duplicated
thread

"TableAdapter generates bad SQL" in the following newsgroup:

microsoft.public.dotnet.framework.adonet

Our member Kevin has replied you in that thread and will continue to work
with you there. I'd appreciate if you have a look there, and if you have
any further questions, please feel free to post there.

Thanks for your understanding.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no
rights.

Jul 26 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.