Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.
用指定参数名和值初始化 ULParameter 对象。
Public Sub New(ByVal parameterName As String, ByVal value As Object)
public ULParameter(string parameterName, object value)
parameterName 参数的名称。对于未命名参数,请使用一个空字符串 ("") 或空值引用(在 Visual Basic 中为 Nothing)作为其值。在 UltraLite.NET 中,ULCommand 对象不使用参数名。
value 传递 System.Object 类以生成参数值。
鉴于系统对 0 和 0.0 常量的特殊处理方法以及对重载方法的解析方式,我们强烈建议您在使用此构造函数时显式将常量值转换为对象类型。
以下代码将创建一个值为 0 的 ULParameter,并将其添加至名为 cmd 的 ULCommand 对象中。
' Visual Basic cmd.Parameters.Add( New ULParameter( "", CType( 0, Object ) ) )
以下代码为 C# 语言等效代码:
// C# cmd.Parameters.Add( new ULParameter( "", (object)0 ) );