Link to home
Start Free TrialLog in
Avatar of codequest
codequest

asked on

ASP.NET DetailsView Update exception handling - truncated data

I'm using a DetailsView for updating a record. If the edit input of some fields is too long, the system produces a "data will be truncated" exception.

I can see where I can detect the error in DetailsViewItemUpdating or DetailsViewItemUpdated, and provide a user message.  However, I believe the visual feedback should be sufficient for this release, i.e. "hey, it didn't take my 30 characters, even though the header label said it would only allow 20".

Is there a way to force the DetailsView to do the truncation and accept the update?

Or some other approach to this data handling exception, which must be pretty common.
ASKER CERTIFIED SOLUTION
Avatar of Ammar Gaffar
Ammar Gaffar
Flag of United Arab Emirates image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of codequest
codequest

ASKER

Worked well.  Very slick.  Thanks, big help!