ERROR [Provider encountered an error while sending command parameter]

  • Thread starter Thread starter Syed Sami R. Shah
  • Start date Start date
S

Syed Sami R. Shah

Hi, ALL
I am getting an error while calling the ExecuteNonQuery method of command. I
am using a stored procedure and setting its parameter values from an
object's properties. Please note that when I hard code the parameter values,
I don't get any error. I am totally clueless about this..... Kindly HELP!

the error is
----------------------------------------------------------------------------
--------------------
Provider encountered an error while sending command parameter[0]
'RETURN_VALUE' value and stopped processing.
Provider encountered an error while sending command parameter[1] 'CSTypeID'
value and stopped processing.
Provider encountered an error while sending command parameter[2]
'DirectionID' value and stopped processing.
Provider encountered an error while sending command parameter[3]
'CSCaseNumber' value and stopped processing.
Provider encountered an error while sending command parameter[4]
'RefCaseNumber' value and stopped processing.
Provider encountered an error while sending command parameter[5] 'StatusID'
value and stopped processing.
Provider encountered an error while sending command parameter[6]
'ResolutionID' value and stopped processing.
Provider encountered an error while sending command parameter[7] 'Message'
value and stopped processing.
Conversion failed for command parameter[8] 'PostingDate' because the data
value overflowed the type used by the provider.
Provider encountered an error while sending command parameter[9] 'PostedBy'
value and stopped processing.
Provider encountered an error while sending command parameter[10] 'Response'
value and stopped processing.
Provider encountered an error while sending command parameter[11]
'ResponseBy' value and stopped processing.
Provider encountered an error while sending command parameter[12]
'ResponseDate' value and stopped processing.
Provider encountered an error while sending command parameter[13]
'ThreadRefID' value and stopped processing.
Provider encountered an error while sending command parameter[14]
'CurrentOwner' value and stopped processing.
Provider encountered an error while sending command parameter[15] 'OutCSID'
value and stopped processing.
----------------------------------------------------------------------------
-------------------

The parameter values are being set like this
----------------------------------------------------------------------------
-
With CaseInfo
params(1).Value = .CSType.CSTypeID
params(2).Value = .Direction.ObjectID
params(3).Value = .CaseNumber
params(4).Value = .RefCaseNumber
params(5).Value = .Status.ObjectID
params(6).Value = .Resolution.ObjectID
params(7).Value = .Message
params(8).Value = .PostingDate
params(9).Value = .PostedBy.UserID
params(10).Value = .Response
params(11).Value = .ResponseBy.UserID
params(12).Value = .ResponseDate
params(13).Value = .ThreadRefID
params(14).Value = .CurrentOwner.UserID
End With
 
I'm not really sure, but It seems like you are executing a Stored Procedure
with this command object. Right?

If yes, it seems like the SP is trying to send a return value to your
command object and as rule you must place the return_value parameter as the
first one in the command's collection and you cannot set it, just get it's
value after SP processing.

hope to help,
regards
Victor Reboucas


Syed Sami R. Shah said:
Hi, ALL
I am getting an error while calling the ExecuteNonQuery method of command.
I
am using a stored procedure and setting its parameter values from an
object's properties. Please note that when I hard code the parameter
values,
I don't get any error. I am totally clueless about this..... Kindly HELP!

the error is
----------------------------------------------------------------------------
--------------------
Provider encountered an error while sending command parameter[0]
'RETURN_VALUE' value and stopped processing.
Provider encountered an error while sending command parameter[1]
'CSTypeID'
value and stopped processing.
Provider encountered an error while sending command parameter[2]
'DirectionID' value and stopped processing.
Provider encountered an error while sending command parameter[3]
'CSCaseNumber' value and stopped processing.
Provider encountered an error while sending command parameter[4]
'RefCaseNumber' value and stopped processing.
Provider encountered an error while sending command parameter[5]
'StatusID'
value and stopped processing.
Provider encountered an error while sending command parameter[6]
'ResolutionID' value and stopped processing.
Provider encountered an error while sending command parameter[7] 'Message'
value and stopped processing.
Conversion failed for command parameter[8] 'PostingDate' because the data
value overflowed the type used by the provider.
Provider encountered an error while sending command parameter[9]
'PostedBy'
value and stopped processing.
Provider encountered an error while sending command parameter[10]
'Response'
value and stopped processing.
Provider encountered an error while sending command parameter[11]
'ResponseBy' value and stopped processing.
Provider encountered an error while sending command parameter[12]
'ResponseDate' value and stopped processing.
Provider encountered an error while sending command parameter[13]
'ThreadRefID' value and stopped processing.
Provider encountered an error while sending command parameter[14]
'CurrentOwner' value and stopped processing.
Provider encountered an error while sending command parameter[15]
'OutCSID'
value and stopped processing.
----------------------------------------------------------------------------
-------------------

The parameter values are being set like this
----------------------------------------------------------------------------
-
With CaseInfo
params(1).Value = .CSType.CSTypeID
params(2).Value = .Direction.ObjectID
params(3).Value = .CaseNumber
params(4).Value = .RefCaseNumber
params(5).Value = .Status.ObjectID
params(6).Value = .Resolution.ObjectID
params(7).Value = .Message
params(8).Value = .PostingDate
params(9).Value = .PostedBy.UserID
params(10).Value = .Response
params(11).Value = .ResponseBy.UserID
params(12).Value = .ResponseDate
params(13).Value = .ThreadRefID
params(14).Value = .CurrentOwner.UserID
End With
 
Back
Top