Error inserting Date from date picker

This public forum is for user-to-user discussions of ASP.NET Maker. Note that this is not support forum.
Post Reply
Savvy
User
Posts: 5

Error inserting Date from date picker

Post by Savvy »

Hello,

I seem to be having issues when inserting a date selected from a date picker control.

The SQL 2012 column has the Date format, ASP.net maker is set to validate the value inserted as 'DD/mm/yyyy'.

Everything works just fine when inserting a single record, it is when doing a grid insert or a bulk update that problems arise. below is the error message that is generated.

Conversion failed when converting date and/or time from character string.

I hope someone could direct me to the problem.


Savvy
User
Posts: 5

Post by Savvy »

Ok so to answer my own question....

I ran the following query:

ALTER TABLE [table]
ALTER COLUMN [column] DATETIME NULL

This is to change the column from DATE to DATETIME. I re-ran asp.net maker to update the project after the change then generated.

now everything works fine, seems that there is a limitation with the DATE date type column.


Webmaster
User
Posts: 9430

Post by Webmaster »

You are probably using the [Database type] = "Microsoft SQL Server" which may detect the data type incorrectly. Always use "Microsoft SQL Server 2005/2008/2012" to load database >= Microsoft SQL Server 2005.


Post Reply