0

Say, I have a SourceList with date fields like these DateReceived, DateEntered. If these field or fields are null then in workflow updates the target list item with 1/1/1900 dates respectively.

What's the fix for this?

0

Actually, 1/1/1900 is SQL Server's default value for datetime. For overcome this problem, you can check the value and if it is empty use SqlDateTime.Null instead of null.

if (!string.IsNullOrEmpty(dateVar))
{
   cmd.Parameters.AddWithValue("@Date", dateVar);
}
else
{
   cmd.Parameters.AddWithValue("@Date", SqlDateTime.Null);
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.