4
Answers

Error: Input string was not in a correct format

Administrator

Administrator

22y
2.2k
1
Hi there I have an error when I'm trying to insert a record into a SQL Server Database. The problem is inserting an integer. I have dropdownlist which displays the CompanyName from one table and I want to insert their cmsId (an integer) into another table. I have set the DataTextField of the dropdownlist to be the CompanyName and the DataValueField to be their cmsID (an integer). I keep getting the following error message "Input string was not in a correct format." What does this mean? It's being mistaken for a string instead of an integer? How do I fix it? If I hardcode the integer into the SQL statement instead of using a parameter (see below), there is no problem at all.
View all
Forum Statistics
  • Please welcome our newest member ken .

  • 3,080,633 users have contributed to 147,418 threads and 483,435

  • In the past 24 hours, we have  5 new threads, 28 new posts, and 19 new users.

  • In last week, the most popular thread is 'How to display all Videos'.