FormatException: Input string was not in a correct format的问题
[FormatException: Input string was not in a correct format.]
System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +10169107
System.Number.ParseDecimal(String value, NumberStyles options, NumberFormatInfo numfmt) +238
System.Decimal.Parse(String s) +39
OrderManagement_Take_Stock_View.SaveData(String stutas) +940
OrderManagement_Take_Stock_View.btnPrint_Click(Object sender, EventArgs e) +30
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +115
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +140
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +29
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2981
请高人帮忙看看以下是哪里出了问题谢谢了
------解决方案--------------------lz你的函数OrderManagement_Take_Stock_View.SaveData(String stutas) 中
调用了Decimal.Parse,但是传入的参数并不是数字,因此会有异常,
可以try catch一下,或者调用TryParse,判断是否转换成功。