A
Adam Knight
Hi all,
I am trying to pass a date parameter into an sql (SQL SERVER) stored
procedure.
Initially i was trying to pass the parameter like so:
cmdReportQuestions.Parameters.Add(New
SqlParameter("@sdt",Request.Form("txtStartDt")))
This is obviously incorrect as it is being recieved by my stored procedure
as nvarchar.
Thus in my stored procedure i recieve a can not convert data type error.
How do convert this value to an acceptable data type? (VB.NET)
The SQL SERVER parameter data type is SMALLDATETIME ?
Also, the date is in dd/mm/yyyy format.
Does VB.NET have any formatting functions to convert it to mm/dd/yyyy?
Cheers,
Adam
I am trying to pass a date parameter into an sql (SQL SERVER) stored
procedure.
Initially i was trying to pass the parameter like so:
cmdReportQuestions.Parameters.Add(New
SqlParameter("@sdt",Request.Form("txtStartDt")))
This is obviously incorrect as it is being recieved by my stored procedure
as nvarchar.
Thus in my stored procedure i recieve a can not convert data type error.
How do convert this value to an acceptable data type? (VB.NET)
The SQL SERVER parameter data type is SMALLDATETIME ?
Also, the date is in dd/mm/yyyy format.
Does VB.NET have any formatting functions to convert it to mm/dd/yyyy?
Cheers,
Adam