Value of type 'String' cannot be converted to '1-dimensional array of System.Object'

G

Guest

Hello,

I have a function in C# that accepts a stored proc name and an array of parameters, and then returns a dataset, which works just fine.
I have converted the function to VB:

Public Shared Function GetDataSet(ByVal storedProcedure As String, ByRef parameterArray As Object()) As DataSet
 
G

Guest

I think I have it

I was missing the ParamArray keyword

Public Shared Function GetDataSet(ByVal storedProcedure As String, ByVal ParamArray parameterArray As Object()) As DataSe



End Functio
 
K

Kevin Spencer

You have typed your TWO input parameters as (1) String, and (2)
1-Dimensional array of Object.

You're calling the function and passing THREE parameters to it: (1) String,
(2) String, and (3) Number.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

Sean said:
Hello,

I have a function in C# that accepts a stored proc name and an array of
parameters, and then returns a dataset, which works just fine.
I have converted the function to VB:

Public Shared Function GetDataSet(ByVal storedProcedure As String,
ByRef parameterArray As Object()) As DataSet
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top