asp.net.ph

SqlParameter Constructor ( String, Object )

System.Data.SqlClient Namespace   SqlParameter Class


Initializes a new instance of the SqlParameter class with the parameter name and value.

[ VB ]
Overloads Public Sub New ( _
   ByVal name As String, _
   ByVal value As Object _
)

[ C# ]
public SqlParameter (
   string name,
   object value
);

[ C++ ]
public: SqlParameter (
   String* name,
   Object value
);

[ JScript ]
public function SqlParameter (
   name : String,
   value : Object
);

Parameters

name
The name of the parameter to map.
value
The value of the new SqlParameter object.

Remarks

When you specify an Object in the value parameter, the SqlDbType is inferred from the .NET Framework type of the Object.

Example

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

public void CreateSqlParameter ( ) {
   SqlParameter myParam = new SqlParameter ( "@Category", "Beverages" );
   myParam.Direction = ParameterDirection.Output;
}
  C# VB

See Also

SqlParameter Members   SqlParameter Constructor Overload List Skip Navigation Links




Previous page Back to top Next page

Check out related books at Amazon

© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

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