日期:2009-09-04  浏览次数:20422 次

示例

Public Sub CreateOleDbParameter()

Dim myParameter As New OleDbParameter()


myParameter.ParameterName = "Description"

myParameter.OleDbType = OleDbType.VarChar

myParameter.Direction = ParameterDirection.Output

myParameter.Size = 88



Dim myParameter As OleDbParameter = New OleDbParameter("Description", "Beverages")



Dim myValue As String = "12 foot scarf - multiple colors, one previous owner"

Dim myParameter As New OleDbParameter("Description", OleDbType.VarChar)

myParameter.Direction = ParameterDirection.Output

myParameter.Size = myValue.Length

myParameter.Value = myValue



Dim myParameter As New OleDbParameter("Description", OleDbType.VarChar, 88)

myParameter.SourceColumn = "Description"

myParameter.SourceVersion = DataRowVersion.Current



Dim myParameter As New OleDbParameter("Description", OleDbType.VarChar, 88)

myParameter.Direction = ParameterDirection.Output



Dim myParameter As New OleDbParameter("Description", OleDbType.VarChar, 88, "Description")

myParameter.Direction = ParameterDirection.Output



Dim myParameter As New OleDbParameter("Description", OleDbType.VarChar, 11, ParameterDirection.Output, True, 0, 0, "Description", DataRowVersion.Current, "garden hose")

End Sub



创建参数后需要将其添加至相应命令或存储过程的参数集中