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?
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 you have a solution for this?
Adam Rice, Sep 17, 2012
Launch Sql Server Configuration Manager and go to "SQL Server Services" and you should see the Instance ID's under "Name". the name should read "SQL Server(InstanceIDOfYourInstances). Right now I am showing 3. Make sure it is also running. If it's not running right click and start it. Something else, right click the 2008 express version and go to properties and make sure "Built-in Account: " is selected and "Local System" is selected in the dropdown and restart the service. Make sure you restart.
Aug 05, 2011
The purpose of the Take() method is to convert the business object into an array with contains the SQL parameter names and values. This is used in combination with Insert and Update queries in the Data Objects project.
An example on where this is used can be found in the SqlServerCustomerDao class. On line 90 the Db.Insert method is called with on of the parameters the return value of the Take() method.
The implementation of the Take() method is shown on line 157. Using the Take() method this way reduces repeated code and makes the function easier to read.
Hope this helps.
Maurits van Beusekom, Sep 02, 2012