4
Answers

Error: Input string was not in a correct format

Administrator

Administrator

22y
2.1k
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 kamonwan sapyou.

  • 3,076,445 users have contributed to 147,419 threads and 483,388

  • In the past 24 hours, we have  6 new threads, 16 new posts, and 175 new users.

  • In last week, the most popular thread is 'Delta lake vs Lakehouse in Fabric?'.