Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to pass more than one parameter using common...

685463Mar 30 2009 — edited Apr 28 2009
Hi,

I am using ODP.NET with my 2005 VB

I want to create function from where I can pass more than one parameter to execute SP, or query just like i created for SQL SERVER as below

Public shared Function CreateParameter(ByVal paramname As String, ByVal paramvalue As Object) As DbParameter

Dim param As DbParameter
param = New SqlParameter
param.ParameterName = paramname
param.Value = paramvalue
Return param

End Function
Public Shared Function ExecuteQuery(ByVal sql As String, ByVal commtype As CommandType, ByVal ParamArray parameter As DbParameter())

Dim cmd As DbCommand = New SqlCommand()
cmd.Connection = OpenConnection()
cmd.CommandType = commtype
cmd.CommandText = sql
cmd.Parameters.AddRange(parameter)
Dim RetVal As Integer = cmd.ExecuteNonQuery()
Return RetVal
End Function

specially part is in bold to be converted

I tried like but oracleCommand.parameters doesnt support AddRange

please help me out

Regards
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 26 2009
Added on Mar 30 2009
3 comments
2,891 views