Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Basics
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old March 21st, 2006, 02:56 AM
Registered User
Join Date: Mar 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default String or binary data would be truncated

I dont have my extact code on this machine, but this is the situation... I am trying to add a string to a SQL database table that looks like this "14%,77.5,3.5,3.9,4.9, 19%, 17%, 19.5,..." and it goes on a few more digits separated by commas.

The field it is going in to is set as 'char' type and I set it as high as 200 for maxlength. I still get the error message "String or binary data would be truncated" when I try to update the field with the data above.

Old March 21st, 2006, 08:49 AM
Wrox Author
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons

This means that your string is excceding 200 characters you will either A) Have to convert your datatype to varchar or nvarchar or B)Decrease the size of your string.

"The one language all programmers understand is profanity."

Similar Threads
Thread Thread Starter Forum Replies Last Post
String or binary data would be truncated. Cinderella Classic ASP Basics 3 June 5th, 2004 04:36 AM
Data truncated error message - why? wawdbd Visual C++ 0 April 22nd, 2004 03:52 AM
String getting truncated while displaying in asp anupamda Classic ASP Databases 2 February 10th, 2004 12:08 PM
String to Binary, Binary to String matt.fields VB.NET 2002/2003 Basics 3 November 5th, 2003 05:02 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.