Dim q As String = Main.rdcConnector1.GetCommand(cmd.Name)
Dim params() As Object = cmd.Parameters
If q.Contains("$TABLE$") Then
q = q.Replace("$TABLE$", cmd.parameters(0))
'***************************************************
'The command below will create a new array named params that
'is sized one less then the Parameter array passed to the server
'***************************************************
Dim params(cmd.Parameters.Length - 1) As Object
'copy the items to params
'*******************************************************
'As @Erel points out, here you should copy the cmd.Parameters array
'to the params array, skipping the first element of cmd.Parameters.
'If you do not do this, the call below (ExecQuery2) will be called with an
'empty array!
'*******************************************************
End If
Dim rs As ResultSet = con.ExecQuery2(q,params)