[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Input string not in correct format... why?

Posted on 2011-10-27
3
Medium Priority
?
335 Views
Last Modified: 2013-12-16
I have a column in a database that is defined as small int, with a value of 1.  I am getting an error on this code:

 
tbCopies.Text = data.GetInt16((int)tBooks.Quantity).ToString();

Open in new window


The error is "Input string not in correct format".  Why
0
Comment
Question by:rmmarsh
  • 2
3 Comments
 
LVL 22

Accepted Solution

by:
pivar earned 2000 total points
ID: 37040251
Hi,

GetInt16 expects the index of the smallint column in the table. Quantity is just a value?

/peter
0
 
LVL 22

Expert Comment

by:pivar
ID: 37040261
In this example, the Quantity value probably gives you an index to a (for example) text column.
0
 

Author Closing Comment

by:rmmarsh
ID: 37040286
Thata was it!  Changed the format to "smallint" and it works now.

Thank you very much!

Rolf
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A basic question.. “What is the Garbage Collector?” The usual answer given back: “Garbage collector is a background thread run by the CLR for freeing up the memory space used by the objects which are no longer used by the program.” I wondered …
In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses
Course of the Month20 days, 9 hours left to enroll

868 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question