WebCab Probability and Statistics for .NET v3.3 Demo

ADOMediator.Update Method 

Invokes a method upon a set of given values and writes its result into the database, by using a stored procedure or an UPDATE/INSERT command.

public void Update(
   string methodName,
   object[] inputValues,
   string outputQuery,
   object resultParameters,
   bool storedProcedure
);

Parameters

methodName
The name of the method used in evaluating the input data returned by inputQuery. If the underlying component contains several methods named meethodName, the one that fits best the number columns returned is chosen.
inputValues
The parameters of method methodName, as an array of values.
outputQuery
An SQL update/insert query or a stored procedure invoked with each input row, meant to write the results into the database. If the storedProcedure flag is set, the outputQuery is run as a stored procedure, otherwise this method will treat it as an SQL statement.
resultParameters
Named parameters to assign the results of methodName to. If only one result is expected, pass in a String. If more than one value is supposed to be returned by methodName, pass in a String array representing the names of the Input parameters of the output query.
storedProcedure
If true, the output query is run as a stored procedure, if false the output query will be invoked as an ordinary SQL statement.

Remarks

Additionally, you should specify the named parameters where to place the result returned by methodName, either as a String, or an array of String objects.

Exceptions

Exception TypeCondition
ADOMediatorExceptionThrown to indicate run-time errors.

Example

The following piece of code invokes method MyMethod with two double-type parameters and writes the results in the database using an UPDATE statement.

            ado.Update ("MyMethod", new Object[] {500, 5.51},
                  "UPDATE CUSTOMER SET MONEY=@MONEY WHERE C_ID='00001'",
                  "@MONEY", false);
            

See Also

ADOMediator Class | WebCab.Libraries.Statistics.Correlation.ADO Namespace