troubleshooting Question

Exception when trying to insert into AS400 DB2 from VB.NET

Avatar of vbcoder14
vbcoder14 asked on
IBM System iDB2Visual Basic.NET
9 Comments1 Solution2393 ViewsLast Modified:
I have an ODBC connection setup to a DB2. I am trying to insert into a table from VB.NET, the code as follows:

Dim info as String = "'abc123'"
Dim insert as String = "INSERT INTO LIBRARY.FILE (LABEL) VALUES ('"& info &"')"
adpODBC.SelectCommand = New OdbcCommand(insert, odbcConnection)
adpODBC.Fill(ds)

After doing the Fill command, I get the following excepton:
System.OverflowException: "Arithmetic operation resulted in an overflow"

The LABEL (or FIELD) in the TABLE (or FILE) that I am using is of length 150. The Value trying to be inserted is much smaller than that, hence, I am stuck finding out why an overflow exception. Could it be a wrong syntax?
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 9 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 9 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros