C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » ASP.NET »

Error


Posted Date: 24 Sep 2008      Posted By: Elz      Member Level: Gold     Points: 1   Responses: 2



Hi all

Error:Input string not in correct format
double actual =Convert.ToDouble(dt.Rows[0][2].ToString());//datatype of actual double
double estimated =Convert.ToDouble(dt.Rows[0][3].ToString());// estimated double
string done =dt.Rows[0][4].ToString();//varchar



a = (actual * (10 - Convert.ToDouble(done))) / Convert.ToDouble(done); //here error
how this can be changed





Responses

Author: Anil Kumar Pandey    24 Sep 2008Member Level: DiamondRating: 2 out of 52 out of 5     Points: 3

hi,

please check that what are the values coming in the dt.Rows[0][2].ToString())

may be the value u are trying to convert is not in a convertable format..


Regards
Anil

Thanks & Regards
Anil Kumar Pandey



Author: Sathish Kumar    24 Sep 2008Member Level: GoldRating: 2 out of 52 out of 5     Points: 4

hi,

check the Value of dt.Rows[0][2],dt.Rows[0][3],t.Rows[0][4] Whether it holding any string or null value.

double actual =Convert.ToDouble(dt.Rows[0][2].ToString());
double estimated =Convert.ToDouble(dt.Rows[0][3].ToString());
double done =Convert.ToDouble(dt.Rows[0][4].ToString());
a = (actual * (10 - done)) / done;



Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.


Next : Javascript Calendar Control in C#
Previous : can you give me the code to keep the collapsible panel open
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use