Groups | Blog | Home
all groups > vb.net data > july 2007 >

vb.net data : Error: data truncated.


Michel Vanderbeke
7/30/2007 11:48:18 PM
Hello,


When writing a text to a SQL database nvarchar(6) field, I get following
error when the size of the input is larger than the available length of the
textfield (larger than 6).

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

How can I make that at least the first 6 characters will be saved and the
input is indeed truncated without generating an error or at least to catch
the error silently?


Many thanks and greetings,

Michel

Phil
7/31/2007 12:00:00 AM

[quoted text, click to view]
See if your database supports a left() or substr() function, or do this in
your VB code.

AddThis Social Bookmark Button