473,396 Members | 2,024 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

SQL Exception Unhandled Error

Here iam trying to insert some values to SQLServer 2005 Database.The following error displaying.I changed the corresponding column size,still the error persists.how can i sove this error-:

'String or binary data would be truncated.
The statement has been terminated'
Feb 28 '12 #1
4 1250
PsychoCoder
465 Expert Mod 256MB
That error message says you're trying to insert a value that's larger than the specified length in SQL. So you got 2 choices; increase the columns max length or shorten what you're trying to insert.
Feb 28 '12 #2
I changed the corresponding column size,still the error persists
Feb 28 '12 #3
PsychoCoder
465 Expert Mod 256MB
OK show us what you're doing to generate this error (show the code), also show the code of your table and tell us which variable generates this error message.
Feb 28 '12 #4
This is the insert function in vb.net

Me.Personal_detailsdbTableAdapter.Insert(Me.Firstn ameTextBox.Text, Me.LastnameTextBox.Text, _
Me.PassportnoTextBox.Text, Me.PlaceofbirthTextBox.Text, _
Me.SexTextBox.Text, Me.DobDateTimePicker.Value)



This is the SQL Database Table Design

firstname nvarchar(50) Checked
lastname varchar(20) Checked
passportno nvarchar(50) Unchecked(Primary Key)
placeofbirth varchar(25) Checked
sex varchar(20) Checked
dob datetime Checked
Feb 28 '12 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: J. Muenchbourg | last post by:
I'm getting an Exception occured error on line 4 (For i =1...) <% Function ProperCase(strIn) strOut = "" boolUp = True For i = 1 To Len(strIn) c = Mid(strIn, i, 1) if c = " " or c = "'" or c...
1
by: manish | last post by:
Hi, I am a fresher in the programming field i.e although I have done programming at the basic level but at professional level I am very new and I am facing many problems. These probllems are...
1
by: Lawrie | last post by:
hi all have started getting the above error when debugging the section of code that causes this is driving me crazy as i have used this on other occassions with no runtime errors. May be i am...
6
by: Paul Steele | last post by:
I often use the following code to check if a program is already running: if (Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName).Length > 1) ... This works find on all of my...
5
by: Peter Steele | last post by:
We have an application that when it runs in the IDE in debug mode an unhandled exception is occurring in a system header file associated with STL stirngs. The actual statement that crashes is ...
1
by: Samuel R. Neff | last post by:
Occasionally we get this error message when running an app on a test machine: .exe - Common Language Runtime Debugging Services Application has generated an exception that could not be...
0
by: sobhan | last post by:
Hi, Yhis is sobhan, i haveused Microsoft Access in my Application.it works fine but sometimes an error occurs oledb exception :Unspecified Error .what is the solution. plz help
0
by: Amy L | last post by:
While stress testing an application we have I ran into a Com-Interop error that was unhandled. The actual error said that the pagefile was too small and gave me an HResult error. The odd part was...
0
by: Gary | last post by:
Trying to install VB6 (learning edition) on Windows XP. When running the SETUP.EXE to install Visual Basic 6.0 it gives the error... "An unhandled win32 exception occured in vs60wiz.exe" or...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.