I too had this same question but was able to figure out what was going on...sort of...
I am actually in the process of implementing this functionality in an application I am working on.
There is a problem though...
If you do not plan to use all of the variables in the SQL statement (such as the below delete command) you will get an error.
Am I missing something? Didn't anyone test this out?
Below only CustomerID and Version are needed in the SQL.
However, when you use the "Take" functionality you are applying CompanyName, City, and Country to the SQL text event though they are not needed. This creates an error...
You are actually loading up parameters you are not going to use:
In Oracle, if you attempt to execute this you get:
"ORA-01036: illegal variable name/number"
This means that you are attempting to apply parameters that are not actually in the SQL text.
Do factory folks,
Do you have a solution for this?
private object Take(Customer customer)
return new object
public void DeleteCustomer(Customer customer)
string sql =
@"DELETE FROM [Customer]
WHERE CustomerId = @CustomerId
AND Version = @Version";