Hi There,
My latest problem is passing a null value to a stored procedure thru a
VB .NET class. The date column in the sql server table can take a null. The procedure works fine when running thru a sql query window in sql server (ie exec procname <i>par_list</i>).
The problem is when calling the proc thru
vb code, I get an error when passing a null value after declaring the parameter to be a datetime.
The code below generates an error for cmd.ExecuteNonQuery() if prmDOB is a null value or nothing. It works fine if there is an actual date, but the table can hold a null and I would like to keep it that way.
Dim prmDOB As SqlParameter = New SqlParameter("@DOB", SqlDbType.DateTime)
prmDOB.IsNullable = True
prmDOB.Direction = ParameterDirection.Input
prmDOB.Value = DOB
cmd.Parameters.Add(prmDOB)
cmd.ExecuteNonQuery()
Thanks for listening and the prior help.
Sincerely,
Paul O