DB2Parameter Constructor (String, DB2Type, Int32, String)

Initializes a new instance of the DB2Parameter class with the parameter name, data type, width, and source column name.

Namespace:
IBM.Data.DB2
Assembly:
IBM.Data.DB2 (in IBM.Data.DB2.dll)

Syntax


[Visual Basic]
Public Sub New( _
   ByVal name As String, _
   ByVal type As DB2Type
, _
   ByVal size As Integer, _
   ByVal sourcecolumn As String _
)
[C#]
public DB2Parameter(
   string name,
   DB2Type
 type,
   int size,
   string sourcecolumn
);
[C++]
public: DB2Parameter(
   String* name,
   DB2Type
 type,
   int size,
   String* sourcecolumn
);
[JScript]
public function DB2Parameter(
   name : String,
   type : DB2Type
,
   size : int,
   sourcecolumn : String
);

Parameters

name
The name of the parameter.
type
One of the DB2®Type enumeration values.
size
The width of the parameter.
sourcecolumn
The name of the source column.

Example

[Visual Basic, C#] The following example creates a DB2Parameter and sets some of its properties.

[Visual Basic]
Public Sub CreateDB2Parameter()
    Dim myParameter As New DB2Parameter(
      "Description", DB2Type.VarChar, 88, "Description")
      myParameter.Direction = ParameterDirection.Output
End Sub 'CreateDB2Parameter

[C#]
 public void CreateDB2Parameter()
 {
    DB2Parameter myParameter = new DB2Parameter("Description",DB2Type.VarChar,
                 88,"Description");
    myParameter.Direction = ParameterDirection.Output;
 }