Question

I am working on a GridView control where I wanted to display several data in the grid. The columns are; 2 string names, 1 integer, and datetime. When I want to input data to show in the grid to make sure it works, an exception error (a code given from a professor) shows up saying;

System.ArgumentException: The version of SQL Server in use does not support datatype 'date'.

However, I figure what was the problem. In my HTML source, I was looking in the Delete, Update, Insert Parameters, in the Date column, I had; Dbtype="date". I have to change it to; Type="DateTime" and it works.

What caused it to be Dbtype="date" instead of Type="DateTime"? Much appreciated when answered. Thanks.

Was it helpful?

Solution

Probably your mssql server veriosn is 2005 , so it doesn't support "date" as datatype

OTHER TIPS

Actually, DATE is a datatype introduced in MS SQL Server 2008, then in MS SQL Server 2012. Most probably you're using MS SQL Server 2005 or earlier. Please check the version of your SQL Server.

I hope it helps you.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top