Tell me more ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I'm developing a Sharepoint 2010 BCS using Visual Studio 2010. One of my requirements for this particular ECT is that it have a datetime column that's not a required field. The column in the database is date, null. I haven't found anyone else who's had the same issue, so I'm enquiring here. I can set a null date value in the ReadItem Method, using the following:

if (opReporting.AdjustedEffectiveEndDate.Value.Year == 1)
{
    opReporting.AdjustedEffectiveEndDate = (Nullable<DateTime>)null;
}

The problem is that when I save the Update or Create Method forms with no value in the date field, I get the following error:

Failed trying to write value 'null' with Type '< unavailable >' as a Field of Type 'System.DateTime'.

This error is thrown before the breakpoint in the update process is hit.

Any help would be appreciated.

share|improve this question

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.