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.