Convert a 13 Character string to a Integer for access DB

Jefferson

Member
Joined
Aug 16, 2005
Messages
21
Programming Experience
Beginner
Hi,

I have created an application that reads information typed by a user in a textbox into a Dataset then updates this to a Access Database.
I use this Textbox to capture the values of the Field in the Database of which the DB field is a Text field, but when executing the Line *** drw1("ID") = txtID.text *** the code fails and returns the following error.
****************************************************
An unhandled exception of type 'System.ArgumentException' occurred in system.data.dll
Additional information: System.OverflowException: Value was either too large or too small for an Int32.
at System.Convert.ToInt32(Int64 value)
at System.Int64.System.IConvertible.ToInt32(IFormatProvider provider)
at System.Convert.ToInt32(Object value)
at System.Data.Common.Int32Storage.Set(Int32 record, Object value)
at System.Data.DataColumn.set_Item(Int32 record, Object value)Couldn't store <8011235021085> in ID Column. Expected type is Int32.
*****************************************************

I have tried *** drw1("ID") = int32.parse(txtID.text) ***
*** drw1("ID") = int64.parse(txtID.text) ***
But neither of these seem to work????

Jefferson
 
int64 - Resolved

:) Hi,

I changed the fields in the Database from Number to text for the ID and Telephone numbers, and then reconnected the database to vb.net...
All seems to be working fine now, thanks for the help!!!
 

Latest posts

Back
Top