Advertisement

07.02.2008 at 02:31PM PDT, ID: 23535193
[x]
Attachment Details

"Input string was not in a correct format" in ASP.NET/C#

Asked by ahoegh in Microsoft Visual C#.Net, Programming for ASP.NET

Tags: , ,

Hi,

I've developed a small web page using Visual Studio. What happens is basicly this: I have some controls, that gets populated using object datasources from a typed dataset. Theese controls are drop down lists, that hold the ID of data in different tables (disks, cpu's, ram etc.). The structure of the tables are equal (ID, name, price). Furthermore, I have a detailsview that gets populated by an object datasource. This datasources takes the ID's from the controls as parameters, which it passes by to a stored procedure in the typed dataset. The outcome is a detailview showing the price of a certain combination of hardware components.

This actually worked fine, but not it doesn't anymore. I keep getting this error:

"Exception Details: System.FormatException: Input string was not in a correct format."

If I supply the parameters for the last object datasource manually (for example 1, 1, 1, 1, 1) there is no problem at all. It is only when I start supplying theese input parameters as SelectedValues from the dropdown-lists, that the problem occours - more precisely, it is the SelectedValue of the RAM-dropdown list that causes the problem.

The reason I am so confused is that all the dropdown controls are equal and so are all the tables in the database. The datatypes in all the tables are ID (int), Name (nvarchar(50)) and Price (money). Therefore, I simply do not understand why the RAM-dropdown makes this problem.Start Free Trial
[+][-]07.02.2008 at 02:42PM PDT, ID: 21920975

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.02.2008 at 03:41PM PDT, ID: 21921484

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Visual C#.Net, Programming for ASP.NET
Tags: Visual C#, Firefox v. 3.0, Exception Details: System.FormatException: Input string was not in a correct format.
Sign Up Now!
Solution Provided By: ahoegh
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628