Server Error in '/' Application.
--------------------------------------------------------------------------------Input string was not in a correct format. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
Line 218:            else
Line 219:            {
Line 220:                string x = Convert.ToString(Convert.ToDouble(allmoney()) / (Convert.ToDouble                      (allnotmoney()) + Convert.ToDouble(allmoney())) * 100);
Line 221:                this.nbili.Text = x.Substring(0, x.IndexOf('.') + 3);
Line 222:            }
 
Source File: d:\JNJ\expence\expence.aspx.cs    Line: 220 
谁知道怎摸解决啊!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

解决方案 »

  1.   

    Server Error in '/' Application.
    --------------------------------------------------------------------------------Input string was not in a correct format. 
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.FormatException: Input string was not in a correct format.Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  
      

  2.   

    出错时 allmoney() 取值是多少 用 double.TryParse()格式化好点.
      

  3.   

    调试嘛,这种错误
    多半是你allmoney()返回值的问题
      

  4.   

    allmoney()allnotmoney()你不会返回类型是string?检查你的代码是不是返回空串了,或者非数字这种函数最好返回double
      

  5.   

    Stack Trace: 
    [FormatException: Input string was not in a correct format.]
       System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +7469351
       System.Number.ParseDouble(String value, NumberStyles options, NumberFormatInfo numfmt) +115
       System.Double.Parse(String s, NumberStyles style, NumberFormatInfo info) +192
       System.Convert.ToDouble(String value) +63
       expence_expence.gvpayfor() +750
       expence_expence.Page_Load(Object sender, EventArgs e) +171
       System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
       System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
       System.Web.UI.Control.OnLoad(EventArgs e) +99
       System.Web.UI.Control.LoadRecursive() +50
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627 
      

  6.   

    大家好!.项目在我的机器上是正常的.在很多个人机器上包括window7系统上都是正常的.!一不暑到服务器上就不行了!!!!!!!!!1
      

  7.   


    Input string was not in a correct format.  还是格式化的问题, 或者把电脑抱机房去测试.@-@.
      

  8.   

    输入字符串格式不正确
    单步跟踪查看字符串值TryParse
      

  9.   

    机房服务器上是没有开发环境的.测试也只能把做好的项目放到上面看看正不正确!
    大家在看看我的出来代码是哪里有问题.怎么解决都给提提!!!!!!!
    this.xjiao.Text = fallmoney();
            this.xwei.Text = fallnotmoney();
            if (fallmoney() == "0")
            {
                this.xbi.Text = "0";
            }
            else
            {
                if (fallnotmoney() == "0" && fallmoney() != "0")
                {
                    this.xbi.Text = "100";
                }
                else
                {
                    string x = Convert.ToString(Convert.ToDouble(fallmoney()) /(Convert.ToDouble(fallnotmoney()) + Convert.ToDouble(fallmoney())) * 100);
                    this.xbi.Text = x.Substring(0, x.IndexOf('.') + 3);
                }
            }
    怎么解决办法都提提啊!我等着呢.............................................
      

  10.   

    if (fallnotmoney() == "0" && fallmoney() != "0")
    {
    this.xbi.Text = "100";
    }
    你看看 是不是 错在  fallnotmoney() fallmoney() 都是 0  了哦
      

  11.   

    不是.不是不可能错在这里.Convert.ToDouble我感觉这个转换是不是有问题!