The version of SQL Server in use does not support datatype 'datetimeoffset'

Hi,

I got the following error in an insert query. I use Visual Studio 2008 and Sql Server 2008 Express edition
Actually the database was in a Sql Server 2005 database. I created a backup and restored it into MSSQL 2008 db. Changed the compatibility to Sql Server 2008.
One more note. I can insert datetimeoffset values with running the stored procedure manually.

Error
The version of SQL Server in use does not support datatype 'datetimeoffset'



CREATE PROCEDURE [dbo].[SpValueInsert]
(
	@ID_ResultCode bigint,
	@TheTime datetimeoffset,
	@Value decimal(18, 3)
)
AS

SET NOCOUNT OFF;
INSERT INTO [dbo].[Values] ([ID_ResultCode], [TheTime], [Value]) VALUES (@ID_ResultCode, @TheTime, @Value)

Open in new window

emresamisuzerAsked:
Who is Participating?
 
emresamisuzerAuthor Commented:
I used dataset and tableadapters. Somehow existing tableadapters causes problems. Anyway, I created all the dataset again. And it solved my problem.

Thanks.
0
 
Easwaran ParamasivamCommented:
Please do include BEGIN....END statement in the SP.
0
 
emresamisuzerAuthor Commented:
Nothing changed.

I created a new dataset and I was able to insert with it. But I have lots of definitions in my current dataset and I don't want to re-create all of them again.
0
 
Easwaran ParamasivamCommented:
DataAdapter's ExecuteNonQuery() method has to be used to execute the insert statement. I don't know why do you fill the dataset. Could you send me the code snippets you are working on so that I could get clear picture?
 
 
 
0
 
Anthony PerkinsCommented:
>>Anyway, I created all the dataset again. And it solved my problem.<<
Excellent.  Now please close the question.

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.