Pass a Date to stored procedure

M

Mike Lopez

Hello.

I have a stored procedure that accepts a Date field as one of its
parameters.

When I try to run the webservice that I wrote to call the SP I get an "Value
in date, time, or timestamp string not valid."

Below is the code. The parameter is "Vehicle_Inservice_date". When the code
runs in an old ASP page, the parameter is defined as type "adDate" and it
works fine.

How do I pass a date field to a SP? I'm using C#. I guess I need the
equivalent of "adDate"(?)

Thanks in advance,

Mike

Here's the code:
[WebMethod]
public string Eligibility_Category(
string Product_Code,
string Vehicle_Make_Code,
int Vehicle_Year,
int Vehicle_Odometer,
DateTime Vehicle_Inservice_Date)
{
cnAS400.Open();
myReader = cmAS400.ExecuteReader(CommandBehavior.CloseConnection);
return myReader.ToString();
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,240
Members
46,830
Latest member
HeleneMull

Latest Threads

Top