Using DateTime in a SqlParameter for Stored Procedure, format error

后端 未结 4 1245
予麋鹿
予麋鹿 2020-11-27 20:04

I\'m trying to call a stored procedure (on a SQL 2005 server) from C#, .NET 2.0 using DateTime as a value to a SqlParameter. The SQL type in the s

4条回答
  •  北海茫月
    2020-11-27 20:55

    Just use:

     param.AddWithValue("@Date_Of_Birth",DOB);
    

    That will take care of all your problems.

提交回复
热议问题