P
pedestrian
I'm using OleDbDataAdapter to update records to the Access database.
Refer to the "Introduction to Data Concurrency in ADO.NET" topic in MSDN:
"The Saving-All-Values Approach" section
ms-help://MS.MSDNQTR.v80.en/MS.MSDN.v80/MS.VisualStudio.v80.
en/dv_raddata/html/d5293098-4a88-4110-abd2-34d9e6661664.htm
The Update command text is in the following format:
UPDATE Customers SET CustomerID = @currCustomerID,
CompanyName = @currCompanyName, .......
WHERE (CustomerID = @origCustomerID) AND .....
(CompanyName = @origCompanyName OR @origCompanyName IS NULL AND
CompanyName IS NULL) ....... ;
SELECT CustomerID, ......
FROM Customers WHERE (CustomerID = @currCustomerID)
Regarding the named parameter @origCompanyName, there are two occurrences in
the statement (similarly for all other columns that allow null). However,
since OleDb use question marks (?) as parameter placeholders, adding
parameters for the above equivalent of OleDbDataAdapter.UpdateCommand would
logically cause the parameter mis-position problem (unless we are allowed to
add the same parameter twice gracefully).
It seems there's no way to correctly add the same parameters or is there any
way to achieve that?
Thanks for your help...
Refer to the "Introduction to Data Concurrency in ADO.NET" topic in MSDN:
"The Saving-All-Values Approach" section
ms-help://MS.MSDNQTR.v80.en/MS.MSDN.v80/MS.VisualStudio.v80.
en/dv_raddata/html/d5293098-4a88-4110-abd2-34d9e6661664.htm
The Update command text is in the following format:
UPDATE Customers SET CustomerID = @currCustomerID,
CompanyName = @currCompanyName, .......
WHERE (CustomerID = @origCustomerID) AND .....
(CompanyName = @origCompanyName OR @origCompanyName IS NULL AND
CompanyName IS NULL) ....... ;
SELECT CustomerID, ......
FROM Customers WHERE (CustomerID = @currCustomerID)
Regarding the named parameter @origCompanyName, there are two occurrences in
the statement (similarly for all other columns that allow null). However,
since OleDb use question marks (?) as parameter placeholders, adding
parameters for the above equivalent of OleDbDataAdapter.UpdateCommand would
logically cause the parameter mis-position problem (unless we are allowed to
add the same parameter twice gracefully).
It seems there's no way to correctly add the same parameters or is there any
way to achieve that?
Thanks for your help...