Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 » UltraLite - .NET Programming » UltraLite .NET 2.0 API reference » ULParameter class » ULParameter constructors

 

ULParameter(String, Object) constructor

Initializes a ULParameter object with the specified parameter name and value.

Syntax
Visual Basic
Public Sub New( _
   ByVal parameterName As String, _
   ByVal value As Object _
)
C#
public  ULParameter(
   string  parameterName,
   object value
);
Parameters
  • parameterName   The name of the parameter. For unnamed parameters, use an empty string ("") or a null reference (Nothing in Visual Basic) for this value. In UltraLite.NET, parameter names are not used by ULCommand.

  • value   A System.Object that is to be the value of the parameter.

Remarks

Because of the special treatment of the 0 and 0.0 constants and the way overloaded methods are resolved, it is highly recommended that you explicitly cast constant values to type object when using this constructor.

Example

The following code creates a ULParameter with the value 0 and adds it to a ULCommand called cmd.

' Visual Basic
cmd.Parameters.Add( New ULParameter( "", CType( 0, Object ) ) )

// C#
cmd.Parameters.Add( new ULParameter( "", (object)0 ) );
See also