Returning date from Stored procedure in ASP.Net/VB.Net

Posted by Mo on Stack Overflow See other posts from Stack Overflow or by Mo
Published on 2010-06-04T09:47:11Z Indexed on 2010/06/05 13:42 UTC
Read the original article Hit count: 335

Filed under:
|
|
|

Hi,

I want to execute a method on VB.Net to return a date which is in the stored procedure. I tried using ExecuteScalar but it doesnt work it retruns error

'Implicit conversion from data type datetime to int is not allowed. Use the CONVERT function to run this query'

Any help would be much appreciated please?

thank you

below is the code

  Public Function GetHolidaydate(ByVal struserID as String) As DateTime

        Dim objArgs1 As New clsSQLStoredProcedureParams

        objArgs1.Add("@userID", Me.Tag)
        objArgs1.Add("@Date", 0, 0, ParameterDirection.Output)

        Return (CDate(ExecuteScalar(clsLibrary.MyStoredProcedure.GetHolidayDate, objArgs1)))

End Function

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about vb.net