SQLDataReader, What is Error #5?

melegant

Well-known member
Joined
Feb 2, 2003
Messages
52
Location
NY
CAUSE DANG IT ALL I CANT FIND A SMEGGING THING ANYWHERE ON THE .NET

and its inhibiting my pro-gress with my application.

Bascially, i have a very small stored procedure i am calling (with 3 paramters).

it is only a select statement. the parameters are correct, and the values as well. I have come to find that error 8114 means a bad data conversion for a stored procedure parameter value. I have some other obsucure ones if anyone is interested.

ERROR HAPPENS HERE
Code:
SQLCMD = New Sqlclient.Sqlcommand(StoredProcedureName,Connection)
SQLCMD.COmmandtype = CommandType.StoreProcedure
some code to add the parameters and the values...which is working because I use this same method with many other SPs..
SQLREADER = SQLCMD.EXECUTEREADER (CommandBehaviour.Default)  Error happens here
error is System Error..THX INFO

anyway. Plaseee..helpp..(5th element anyone?)
 
Last edited by a moderator:
Have you looked in the .NET Framework Class Library?

I found an article called SqlError.Class Property.
Sorry I cant help more than that but the info in the article
might help you sort it out.
Or maybe someone else will know what Error #5 is?

ailzaj
 
I cant find it anywhere in the documentation....

I am starting to think it has to do with the fact that the fields in SQL are bytes, and in the stored procedure i listed the parameters as ints...

i am going to test my theory later..
 
I have discovered the problem!

SQlclient.Sqlexception Error #5 is when you use a stored procedure in a SQLcommand, then try to execute a reader with it before executing a Non-Query...
ex.

sqlcmd.executenonquery

then

sqlreader = sqlcmd.executereader

thanks for all the help

mel
 
Back
Top