In the Parameter window a parameter definition is created or modified.


Parameter name

The first character of the name is always the parameter prefix. For most providers this is the '@' character, it can differ per provider. The rest of parameter name must be a valid C# identifier.

Direction

The parameter direction can be input, output or both. Mostly only the input direction will be used.


Output parameter values are retrieved through the Recordset.OutputParam property.

For example: int a = Recordset.OutputParam.CustomerID;

Properties

The properties only need to be set when direction output is checked. When checked, the DbType, length, precision and scale properties will be set at run-time. Uncheck all 4 checkboxes when the parameter is not used for output.


DbType. The ADO.NET DbType. The type can be changed in the Parameter type list.


Length. The length is usually only set for string type output parameters.


Precision and scale. These are only set for numeric values. Precision is the number of digits in a number. Scale is the number of digits to the right of the decimal point in a number. For example, the number 123.45 has a precision of 5 and a scale of 2.


The values that need to be set for the length, precision and scale properties depend on the selected ADO.NET Provider.

Design value

When Ventura SQL Studio needs to execute the SQL script, each parameter definition is initialized with the design value.


The design value is passed to ADO.NET as a string value.


An empty string or (the word) "null" will be set DbNull (ADO.NET's null value type).


See Execution of SQL scripts for important information about Ventura SQL studio executing SQL scripts at design time.

Parameter type list

From this list a "Framework Type/DbType" combination is selected. The Framework Type is used for values stored in the C# code. The DbType is used for initializing ADO.NET's DbParameter. The list has 3 groups.


Common. contains the most commonly used types.


.NET Framework Type. Uses the .NET Framework type as the starting point.


ADO.NET DbType. Uses the DbType as the starting point.