The conversion of the varchar value overflowed an int column
The conversion of the varchar value overflowed an int column
The conversion of the varchar value overflowed an int column
The conversion of the varchar value overflowed an int column
The conversion of the varchar value overflowed an int column
The conversion of the varchar value overflowed an int column The conversion of the varchar value overflowed an int column The conversion of the varchar value overflowed an int column The conversion of the varchar value overflowed an int column The conversion of the varchar value overflowed an int column The conversion of the varchar value overflowed an int column The conversion of the varchar value overflowed an int column The conversion of the varchar value overflowed an int column
The conversion of the varchar value overflowed an int column The conversion of the varchar value overflowed an int column
The conversion of the varchar value overflowed an int column
Go Back  Xtreme Visual Basic Talk > > > The conversion of the varchar value overflowed an int column


Reply
 
Thread Tools Display Modes
  #1  
Old 04-14-2005, 08:54 AM
dgdolins1 dgdolins1 is offline
Centurion
 
Join Date: Dec 2002
Posts: 124
Default The conversion of the varchar value overflowed an int column


Hi,

I am receiving the following error when I attempt to perform a simple delete:

The conversion of the varchar value '900524004791' overflowed an int column. Maximum integer value exceeded.

This code was working at one point, then SQL Server was moved to a different machine and it no longer works (I am just realizing this). Here is the data layout:

Column,Data Type,Length,Allow Nulls
-----------------------------------
Seq,bigint,8,0
SerialNumber,varchar,50,1
OccupiedBy,bigint,8,1
ItemSeq,bigint,8,1
ComputerNumber,varchar,50,1
Repair,bit,1,1

The '900524004791' seen in the error is data contained in the SerialNumber field.

Here is the code I am using:
Code:
Private Sub DeleteComputer(ByVal compNum As String) Dim cn As OleDbConnection Dim myCommand As OleDbCommand Dim SAuto As String cn = New OleDbConnection(connectionString) cn.Open() myCommand = New OleDbCommand("Delete from Equipment Where ComputerNumber = " & compNum, cn) myCommand.ExecuteNonQuery() cn.Close() End Sub

Any suggestions on why I am receiving this?

Thank you.
Reply With Quote
  #2  
Old 04-14-2005, 08:29 PM
MKoslof's Avatar
MKoslofThe conversion of the varchar value overflowed an int column MKoslof is offline
Cum Grano Salis

Retired Moderator
* Guru *
 
Join Date: Jul 2002
Location: Baltimore, Maryland
Posts: 14,636
Default

If you ComputerNumber field is a defined as a VARCHAR string type, why are you passing a numerical value to it? If the ComputerNumber field only takes numerical values, you should alter the data type. The VARCHAR field should take the string representation of that value..since the bit allocation for a varchar is different than if dealing with a number. Does the string value '900524004791' appear in the ComputerNumber field in the table? (I assume so, since you are trying to delete this record.

Code:
"Delete from Equipment Where ComputerNumber = '" & comNum.ToString() & "'"
__________________
"Artificial Intelligence is no match for natural stupidity." ~unknown
Reply With Quote
  #3  
Old 04-15-2005, 07:24 AM
dgdolins1 dgdolins1 is offline
Centurion
 
Join Date: Dec 2002
Posts: 124
Default

Duh, that fixed it, thanks.
Reply With Quote
  #4  
Old 04-15-2005, 01:32 PM
MKoslof's Avatar
MKoslofThe conversion of the varchar value overflowed an int column MKoslof is offline
Cum Grano Salis

Retired Moderator
* Guru *
 
Join Date: Jul 2002
Location: Baltimore, Maryland
Posts: 14,636
Default

LOL..no problem, sometimes we ALL have days like that.
__________________
"Artificial Intelligence is no match for natural stupidity." ~unknown
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
The conversion of the varchar value overflowed an int column
The conversion of the varchar value overflowed an int column
The conversion of the varchar value overflowed an int column The conversion of the varchar value overflowed an int column
The conversion of the varchar value overflowed an int column
The conversion of the varchar value overflowed an int column
The conversion of the varchar value overflowed an int column The conversion of the varchar value overflowed an int column The conversion of the varchar value overflowed an int column The conversion of the varchar value overflowed an int column The conversion of the varchar value overflowed an int column The conversion of the varchar value overflowed an int column The conversion of the varchar value overflowed an int column
The conversion of the varchar value overflowed an int column
The conversion of the varchar value overflowed an int column
 
The conversion of the varchar value overflowed an int column
The conversion of the varchar value overflowed an int column
 
-->