asp.net.ph

SqlParameter Constructor ( String, SqlDbType, Int32, ParameterDirection, Boolean, Byte, Byte, String, DataRowVersion, Object )

System.Data.SqlClient Namespace   SqlParameter Class


Initializes a new instance of the SqlParameter class with the parameter name, data type, width, source column name, parameter direction, numeric precision, and other properties.

[ VB ]
Overloads Public Sub New ( _
   ByVal parameterName As String, _
   ByVal dbType As SqlDbType, _
   ByVal size As Integer, _
   ByVal direction 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 SqlParameter (
   string parameterName,
   SqlDbType dbType,
   int size,
   ParameterDirection direction,
   bool isNullable,
   byte precision,
   byte scale,
   string srcColumn,
   DataRowVersion srcVersion,
   object value
);

[ C++ ]
public: SqlParameter (
   String* parameterName,
   SqlDbType dbType,
   int size,
   ParameterDirection direction,
   bool isNullable,
   unsigned char precision,
   unsigned char scale,
   String* srcColumn,
   DataRowVersion srcVersion,
   Object* value
);

[ JScript ]
public function SqlParameter (
   parameterName : String,
   dbType : SqlDbType,
   size : int,
   direction : ParameterDirection,
   isNullable : Boolean,
   precision : Byte,
   scale : Byte,
   srcColumn : String,
   srcVersion : DataRowVersion,
   value : Object
);

Parameters

parameterName
The name of the parameter.
dbType
One of the SqlDbType values.
size
The width of the parameter.
direction
One of the ParameterDirection values.
isNullable
true if the value of the field can be null; otherwise, false.
precision
The total number of digits to which Value is resolved.
scale
The number of decimal places to which Value is resolved.
srcColumn
The name of the source column.
srcVersion
One of the DataRowVersion values.
value
An Object that is the value of the SqlParameter.

Example

The following example initializes an SqlParameter using this constructor and displays the ParameterName.

public void CreateSqlParameter ( ) {
   SqlParameter myParam = new SqlParameter ( "@Description", SqlDbType.VarChar,
      100, ParameterDirection.Output, true, 0, 0, "Description",
      DataRowVersion.Current,"garden hose" );
   Response.Write ( myParam.ToString ( ) );
}
  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