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
谁知道怎摸解决啊!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
--------------------------------------------------------------------------------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
谁知道怎摸解决啊!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
解决方案 »
- 为TreeView添加客户端事件,选择节点时获取此节点的值并赋值给一个TextBox
- gridview 中更新娶不到控件dropdownlist
- 为何表单中<asp:TextBox>中按下Enter键,只会回车,不会提交表单?如何解决?
- MVC3路由参数问题
- DataList 控件嵌套,里面的控件显示不出数据,请求帮助!
- 大家好:新建C#交流群成立:5417725
- 网易38岁CEO去世 英年早逝疑与过度劳累有关 (大家注意身体)
- 请问如何注销Cookie ?
- 有人会用框架开发项目吗。类似于CSDN的导航拦的这种。助我解决。100全送
- 问一下关于正则表达式
- 大家评论下:JavaScript挺入服务器端开发语言序列
- 动态导入用户控件ascx的问题
--------------------------------------------------------------------------------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.
多半是你allmoney()返回值的问题
[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
Input string was not in a correct format. 还是格式化的问题, 或者把电脑抱机房去测试.@-@.
单步跟踪查看字符串值TryParse
大家在看看我的出来代码是哪里有问题.怎么解决都给提提!!!!!!!
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);
}
}
怎么解决办法都提提啊!我等着呢.............................................
{
this.xbi.Text = "100";
}
你看看 是不是 错在 fallnotmoney() fallmoney() 都是 0 了哦