Skip to content

Commit

Permalink
Exception thrown if a date/time containing milliseconds is used with …
Browse files Browse the repository at this point in the history
…Microsoft Access. Closes #76. #71.
  • Loading branch information
hisystems committed Oct 5, 2012
1 parent 3c26cf1 commit 8d788b3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions SQL/Serializers/MicrosoftAccessSerializer.cs
Expand Up @@ -32,6 +32,17 @@ public override string SerializeViewExists(SQLViewExists viewExists)
throw new NotSupportedException();
}

/// <summary>
/// Microsoft Access does not support milli-second serialization.
/// </summary>
public override string SerializeDateTimeValue(DateTime dateTime)
{
if (dateTime.Millisecond != 0)
throw new InvalidOperationException("Microsoft Access does not support milliseconds as part of a date/time field");

return base.SerializeDateTimeValue(dateTime);
}

public override string SerializeTableExists(SQLTableExists tableExists)
{
var select = new SQLSelect();
Expand Down

0 comments on commit 8d788b3

Please sign in to comment.