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 = @dotnet.itags.org.CustomerID, CompanyName =
@dotnet.itags.org.CompanyName, ContactName = @dotnet.itags.org.ContactName, ContactTitle = @dotnet.itags.org.ContactTitle,
Address = @dotnet.itags.org.Address, City = @dotnet.itags.org.City, Region = @dotnet.itags.org.Region, PostalCode =
@dotnet.itags.org.PostalCode, Country = @dotnet.itags.org.Country, Phone = @dotnet.itags.org.Phone, Fax = @dotnet.itags.org.Fax
WHERE (CustomerID = @dotnet.itags.org.Original_CustomerID)
SqlDataSource:
UPDATE [Customers] SET [CompanyName] = @dotnet.itags.org.CompanyName, [ContactName] =
@dotnet.itags.org.ContactName, [ContactTitle] = @dotnet.itags.org.ContactTitle,
[Address] = @dotnet.itags.org.Address, [City] = @dotnet.itags.org.City, [Region] = @dotnet.itags.org.Region, [PostalCode] =
@dotnet.itags.org.PostalCode, [Country] = @dotnet.itags.org.Country, [Phone] = @dotnet.itags.org.Phone, [Fax] = @dotnet.itags.org.Fax
WHERE [CustomerID] = @dotnet.itags.org.CustomerID">
--
Regards,
Gary BlakelyHello 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.
thanks. Working that over there
--
Regards,
Gary Blakely
"Steven Cheng[MSFT]" <stcheng@.online.microsoft.comwrote in message
news:XYIwk0IsGHA.2004@.TK2MSFTNGXA01.phx.gbl...
Quote:
Originally Posted by
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.
>
0 comments:
Post a Comment