Hi, I am using the Enterprise Application Blocks (Data Access
Application Block 2005) and all I want to do is pass in a date as a
parameter to a Stored procedure.
e.g
[Begin C# code]
private void testMe(DateTime startDate)
{
// Create a database object
Database db =
DatabaseFactory.CreateDatabase("ConnectionString") ;
// Get back a DataReader
IDataReader _reader = db.ExecuteReader("spMyStoredProcedure",
new SqlParameter("@queryDate", startDate));
}
[End code]
Where @queryDate is a parameter of type DateTime in my Stored
Procedure.
When I try to run the above code I get the following error
"Failed to convert parameter value from a SqlParameter to a DateTime."
?? Any help greatly appreciated
Regards
Mike