473,686 Members | 2,101 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

string or binary data would be truncated

What causes the error 'string or binary data would be truncated'? Here's
the routine that sometimes causes the error, sometimes not:

irow("ctotal") = FormatCurrency( irow("total"), 2, TriState.False,
TriState.True, TriState.True)
ctotal is a char column in an sql server table; total is a currency column
in the same table. Notwithstanding , the conversion appears to be made, even
though the exception is being thrown.

Any help would be appreciated.

Bernie Yaeger


Nov 20 '05 #1
1 2807
Bernie,

If the variable lengths dont match, then this error occurs.
Make sure that the lengths match. Atleast, make sure that the 'Converted To'
length is greater than the 'Converted From' Length.

Hemanth

"Bernie Yaeger" <be*****@cherwe llinc.com> wrote in message
news:um******** *****@TK2MSFTNG P10.phx.gbl...
What causes the error 'string or binary data would be truncated'? Here's
the routine that sometimes causes the error, sometimes not:

irow("ctotal") = FormatCurrency( irow("total"), 2, TriState.False,
TriState.True, TriState.True)
ctotal is a char column in an sql server table; total is a currency column
in the same table. Notwithstanding , the conversion appears to be made, even though the exception is being thrown.

Any help would be appreciated.

Bernie Yaeger

Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
40175
by: RDRaider | last post by:
How can I find which record(s) cause this error: Server: Msg 8152, Level 16, State 9, Line 1 String or binary data would be truncated. The statement has been terminated. I have tried Profiler but I can't get it to tell me which records are causing the error. Here's the script I'm running: EXEC sp_executesql N'UPDATE IMDISFIL_SQL
0
1259
by: benh | last post by:
Does anyone have any insight into how Application Center Test handles binary data in a response body? My problem: I need some specific data from inside a PDF file that is coming down as the response body. The response contains binary data mixed with plain text which is where my data lies. Unfortunately, when I print the response body to the Trace Log it is truncated. The response ContentLength is about 21,000 bytes so I have used...
1
8068
by: languy | last post by:
Hi there I'm having a problem when using the SqlDataAdapter. When calling the Update(DataSet, string) method I get the following error message "String or binary data would be truncated". The rows neither have data that exceeds 8000 chars nor contain any LOB fields. Furthermore the data is transferred between two tables that are bitwise identical. -- snip -- System.Data.SqlClient.SqlCommand command =
0
1756
by: dileepkumar | last post by:
I'm trying to save file data to sqlserver. file data is converted to sysyte.io.stream and passed through webservice and in Business layer i changed the stream to byte array and passed it as a parameter to my stored procedure. Image file or storing in database. but when i try to save a text file its giving an exception "string or binary data would be truncated \r\n the statement has terminated". I used sqlDBType.Image for the parameter tyep....
6
13323
by: dtarczynski | last post by:
Hello. I have problem when i inserting strings with special characters into MS SQL 2005 database for example: http://www.netsprint.pl/serwis/search?q=http%3A%2F%2Fwww%2Ejobpilot%2Epl%2Fprofile%2Frss20%2F%3Ftitle%3Djobpilot%2Epl%2B%2D%2Boferty%2Bpracy%26region%5B%5D%3D505%26appkind%5B%5D%3D1%2C2%26language%5B%5D%3D11%26profession%5B%5D%3D12%2C65%2C14%2C59%26industry%5B%5D%3D19%2C48%2C23%2C24%2C16%2C33%2C26%26limit%3D10 Then i getting this...
7
17705
Coldfire
by: Coldfire | last post by:
i am having error ....details are ASP.Net application...in which I have a textbox <asp:TextBox ID="Other" TextMode=SingleLine CssClass="serviceBox" Width="250" Height="45" Runat="server" MaxLength="1000" /></asp:TextBox> and this textbox is in a <asp:Repeater > which has the count of 35. The textbox value is stored in the SQL DB And the field data-type in the SQL DB is VARCHAR(1000)
6
10563
by: fnoppie | last post by:
Hi, I am near to desperation as I have a million things to get a solution for my problem. I have to post a multipart message to a url that consists of a xml file and an binary file (pdf). Seperately the posting words fine but when I want to create one multipart message with both then things go wrong. The binary file is converted and of datatype byte() The xml file is just a string.
1
2386
by: dreamer247 | last post by:
hii My insert quary is giving an error "Server: Msg 8152, Level 16, State 9, Line 1 String or binary data would be truncated. The statement has been terminated. " What may be the reason of that error.
2
19317
by: sunkesula | last post by:
I update a field in the database that gives the last update time. The first time I edit the item it puts a value in this field. The second time the applications fails with The statement has been terminated. String or binary data would be truncated. What's the deal?? There is enough space for the date/time so I am not sure what is going on here.. Anyone have any ideas?
0
8585
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, weíll explore What is ONU, What Is Router, ONU & Routerís main usage, and What is the difference between ONU and Router. Letís take a closer look ! Part I. Meaning of...
0
8517
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8934
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8770
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
4309
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4534
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2947
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2208
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1940
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.