Thursday 27 June 2013

String or binary data would be truncated. The statement has been terminated.

I Am Trying To Save The Data To Database, Then I Got The Following Exception That
SqlException was unhandled
String or binary data would be truncated. 
The statement has been terminated.

Because The From The Below Screenshot , I Gave The DataType OF Birth Time nchar(10) in Database, Now I Am Trying To Save 14 Characters Of Birth Time. That Means I Am Trying To Save More Characters(Data) Than The Declared DataType. So The Exception Occurs. This Exception Occurs When The DataType Size Does Not Match With The Database Fields Attributes


The Exception Shows As Below Screenshot:

After Giving Sufficient Data To The Database It Runs Successfully.


No comments:

Post a Comment

Note: only a member of this blog may post a comment.