DB2Parameter Constructor (String, DB2Type, Int32, ParameterDirection, Boolean, Byte, Byte, String, DataRowVersion, Object)
Initializes a new instance of the DB2Parameter class with the parameter name, data type, width, source column name, parameter direction, numeric precision, and other properties.
- Namespace:
IBM.Data.DB2- Assembly:
IBM.Data.DB2(inIBM.Data.DB2.dll)
Syntax
[Visual Basic]
Public Sub New( _
ByVal parameterName As String, _
ByVal DB2Type As DB2Type
, _
ByVal size As Integer, _
ByVal parameterDirection As ParameterDirection, _
ByVal isNullable As Boolean, _
ByVal precision As Byte, _
ByVal scale As Byte, _
ByVal srcColumn As String, _
ByVal srcVersion As DataRowVersion, _
ByVal value As Object _
)
[C#]
public DB2Parameter(
string parameterName,
DB2Type
DB2Type,
int size,
ParameterDirection parameterDirection,
bool isNullable,
byte precision,
byte scale,
string srcColumn,
DataRowVersion srcVersion,
object value
);
[C++]
public: DB2Parameter(
String* parameterName,
DB2Type
DB2Type,
int size,
ParameterDirection parameterDirection,
bool isNullable,
unsigned char precision,
unsigned char scale,
String* srcColumn,
DataRowVersion srcVersion,
Object* value
);
[JScript]
public function DB2Parameter(
parameterName : String,
DB2Type : DB2Type
,
size : int,
parameterDirection : ParameterDirection,
isNullable : Boolean,
precision : Byte,
scale : Byte,
srcColumn : String,
srcVersion : DataRowVersion,
value : Object
);
Parameters
- parameterName
- The name of the parameter.
- DB2Type
- One of the DB2®Type values.
- size
- The width of the parameter.
- parameterDirection
- One of the System.Data.ParameterDirection values.
- isNullable
trueif the value of the field can be null; otherwise,false.- precision
- The total number of digits to the left and right of the decimal point to which DB2ParameterClassValue is resolved.
- scale
- The total number of decimal places to which DB2ParameterClassValue is resolved.
- srcColumn
- The name of the source column.
- srcVersion
- One of the System.Data.DataRowVersion values.
- value
- An object holding a value to be passed as a parameter (for example, another IfxParameter instance, or instances of IBM.Data.DB2Types structures or classes).
Example
[Visual Basic, C#] The following example creates a DB2Parameter and displays the ParameterName.
[Visual Basic]
Public Sub CreateDB2Parameter()
Dim myParameter As New DB2Parameter("Description", DB2Type.VarChar, 11,
ParameterDirection.Output, True, 0, 0, "Description",
DataRowVersion.Current, "garden hose")
MessageBox.Show(myParameter.ToString())
End Sub 'CreateDB2Parameter
[C#]
public void CreateDB2Parameter()
{
DB2Parameter myParameter = new DB2Parameter("Description",DB2Type.VarChar,
11,ParameterDirection.Output,true,0,0,"Description",
DataRowVersion.Current,"garden hose");
MessageBox.Show(myParameter.ToString());
}