asp.netdatedatetimegridviewdbtype

ASP.net Visual studio 2008 SQL Data Source


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.


Solution

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