How can I Insert/Update datetime into SQL Server 2005 datetime column in Database from my C# application code?
Posted on 2008-10-27
First of all, here is the architecture I am using:
--SQL Server 2005 database (production), 2008 database (development)
--C# (Silverlight) code on client/application side
--Entity Framework (Model that wraps database objects)
--ADO.NET Data Services (connect Entity Framework to Client commands to execute on DB)
In my development database (SQL Server 2008), everything is working fine when I insert a new DateTime into the one of my datetime columns in the DB. This datetime is generated from the C# client side code (ie. DateTime.Now statement). My Entity Framework model maps the C# DateTime to the Database datetime type.
However, when I try to run the Insert against my production database (SQL Server 2005), I get an error response that says: "The version of SQL Server in use does not support datatype 'datetime2'." But I know that I am not using 'datetime2' anywhere in my C# code or Entity Framework mapping or SQL Server DB's. So I don't know why it is giving me this error response. Does anyone have any idea what might be going on here?