Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
jafrywilson
Constraint Violating Yak Guru
379 Posts |
Posted - 2010-09-08 : 08:42:30
|
| How to send datetime to database from front end.I experienced this error String or binary data would be truncated.The statement has been terminated. |
|
|
jafrywilson
Constraint Violating Yak Guru
379 Posts |
Posted - 2010-09-08 : 08:50:28
|
| And this error in my back endError converting data type nvarchar to datetime. |
 |
|
|
DaleTurley
Yak Posting Veteran
76 Posts |
Posted - 2010-09-08 : 09:09:16
|
| What is the front end written in?In .net insert a DateTime object. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-09-08 : 09:14:58
|
| Post the code you usedMadhivananFailing to plan is Planning to fail |
 |
|
|
jafrywilson
Constraint Violating Yak Guru
379 Posts |
Posted - 2010-09-08 : 09:24:13
|
| cmd.Parameters.Add("@start_date", SqlDbType.DateTime).Value =Convert.ToDateTime(start_date.Trim());First thing i din't convet to date time...And varchar(20) is no enough for my data ..I cleared my error thanks for the kind response Madhivanan & DaleTurley |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-09-08 : 09:26:03
|
quote: Originally posted by jafrywilson cmd.Parameters.Add("@start_date", SqlDbType.DateTime).Value =Convert.ToDateTime(start_date.Trim());First thing i din't convet to date time...And varchar(20) is no enough for my data ..I cleared my error thanks for the kind response Madhivanan & DaleTurley
Are you using varchar(20) for storing dates? If so, you should use proper DATETIME datatypeMadhivananFailing to plan is Planning to fail |
 |
|
|
jafrywilson
Constraint Violating Yak Guru
379 Posts |
Posted - 2010-09-08 : 10:40:15
|
| No no i am using detetime for date ..For mail_id i used varchar(20)..So only error occured |
 |
|
|
|
|
|