I am doing this query in a stored procedure: SELECT TOP 1 [Employe] FROM Transactions WHERE [Employe]=@Name AND Date=@Date
It is supposed to return an employee ID (int). In my application (ASP.NET C#) I get this error when, with a DataReader, I read a line:
*Conversion failed when converting the varchar value * to data type int. *
What exactly is the type * ? And I am not trying to convert anything.
Most likely you are passing
@Nameparameter as avarcharwhereEmployefield is anintfield.Or you could be trying to assign your resulting value of
Employeto anintdatatype then you would be seeing this error.Please post your
Transactionstable definition and your stored procedure code to further troubleshoot.