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

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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
 
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
 
Back
Top