Solved

Input string was not in a correct format

Posted on 2004-04-18
6
610 Views
Last Modified: 2010-04-15
Hi
Can anyone help with the title problem

I have a currency column in the db, when I add it to the site page and convert it to decimal then submit the form I receive the error.

Input string was not in a correct format

the text box is: <%# Math.Round(Double.Parse(CustDetails.FieldValue("BidAmount", Container))).ToString("F") %>

I have no other server side code on the page.

Can anyone help with this problem
George
0
Comment
Question by:Tourist_Search
6 Comments
 
LVL 11

Expert Comment

by:Agarici
ID: 10858228
the error message simply states that the string CustDetails.FieldValue("BidAmount", Container) could not be parsed as a double

try to view the value of that column (display it in a message box for example)

hth.
A.
0
 
LVL 29

Accepted Solution

by:
David H.H.Lee earned 500 total points
ID: 10860469
Tourist_Search,
Try this :
<%# Math.Round(Double.Parse((CustDetails.FieldValue("BidAmount", Container)).ToString())).ToString("F") %>
0
 

Author Comment

by:Tourist_Search
ID: 10860576
Thanks x_com

You have had a busy day today

George
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 29

Expert Comment

by:David H.H.Lee
ID: 10860922
Tourist_Search,
I'm glad if i could help.

x_com
0
 
LVL 20

Expert Comment

by:TheAvenger
ID: 10864201
A little bit faster code would be:

<%# Math.Round(Convert.ToDouble (CustDetails.FieldValue("BidAmount", Container))).ToString("F") %>
0
 

Author Comment

by:Tourist_Search
ID: 10864312
Thanks Avenger
I tried that but for some reason it would not work
George
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project

713 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