asp.net.ph

SqlParameter Constructor ( String, SqlDbType, Int32, String )

System.Data.SqlClient Namespace   SqlParameter Class


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

[ VB ]
Overloads Public Sub New ( _
   ByVal name As String, _
   ByVal dataType As SqlDbType, _
   ByVal size As Integer, _
   ByVal srcColumn As String _
)

[ C# ]
public SqlParameter (
   string name,
   SqlDbType dataType,
   int size,
   string srcColumn
);

[ C++ ]
public: SqlParameter (
   String* name,
   SqlDbType dataType,
   int size,
   String* srcColumn
);

[ JScript ]
public function SqlParameter (
   name : String,
   dataType : SqlDbType,
   size : int,
   srcColumn : String
);

Parameters

name
The name of the parameter to map.
dataType
One of the SqlDbType values.
size
The width of the parameter.
srcColumn
The name of the source column.

Remarks

The Precision is inferred from the SqlDbType parameter.

Example

The following example initializes an SqlParameter using this constructor and sets some of its properties.

public void CreateSqlParameter ( ) {
   SqlParameter myParam = new SqlParameter ( "@Description", SqlDbType.VarChar, 
      100, "Description" );
   myParam.Direction = ParameterDirection.Output;
}
  C# VB

See Also

SqlParameter Members   SqlParameter Constructor Overload List Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph