Hi , All
I default value in textbox for show now date and I used to method
txtDate.Text = Now.ToShortDateString
It's have problem when I want to add new record in table
I get error message "The statement has been terminated. String or binary data would be truncated. "
and I set type in database is char length 10 ,I can't set type is datetime because in SQL Server fix type datetime
It's have length 8 but 8 length it's not enough for default value
Please help me
Thanks
Nisarat
Secondly use 'yyyy-MM-dd' eg. '2005-06-01'(notice the single quote ' ) format while inserting data.
|||
Hi, dinuj
I set type of field date is datetime and set default value "dd/mm/yyyy" but I get error message "Error validating the default for column "datekey""
Thanks
Nisarat
|||
Hi,Dinuj
yes ,I trying set type of field DateKey is DateTime type but ,in SQLServer it's 8 char only and I will trying to defaulf value in this field but It's can not
Thanks
Nisarat
Nisarat wrote: Hi,Dinuj
yes ,I trying set type of field DateKey isDateTime type but ,in SQLServer it's 8 char only and I willtrying to defaulf value in this field but It's can not
Thanks
Nisarat
Is your DateKey column is of DateTime type? DateTime is 8 bytes widenot 8 chars. Are you using Enterprise Manager ? If yes then clickon Default value and set the default date to whatever you want in thisformat 'yyyyMMdd' . For example for today '20050606'
No comments:
Post a Comment