DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Mon, 30 Jul 2007 23:48:18 +0200,    posted on: microsoft.public.dotnet.languages.vb.data        back       

Thread Index
  1    Michel Vanderbeke
          2    Phil N/A


Error: data truncated.   
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
Date:Mon, 30 Jul 2007 23:48:18 +0200   Author:  

Re: Error: data truncated.   

>
> 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?
>

See if your database supports a left() or substr() function, or do this in 
your VB code.
Date:Tue, 31 Jul 2007 09:58:49 +0100   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us