The reason could be that the
updatedOn
parameter is defined as
parameters.Add(new SqlParameter("@updatedOn", SqlDbType.VarChar, 10));
where the length is 10. But the Date with Time together is more than 10 chars long
Note: This could be a possibility, I have not verified.
Secondly, the
SqlDbType
is taken as
VarChar
whereas
DateTime
may be more appropriate as given here
http://msdn.microsoft.com/en-us/library/system.data.sqldbtype.aspx[
^].
Further, the
SqlParameterCollection.AddWithValue
Method is better instead of adding a parameter and then assigning a value, as explained here
http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlparametercollection.addwithvalue.aspx[
^]