2

第一次发布问题,所以我希望我做对了。主要问题是我无法跟踪打开表单时创建的错误,并希望获得有关如何找到触发问题的代码的建议。我将错误粘贴在所有这些下面。不幸的是,这不是指向特定代码行的错误,所以我觉得卡住了。

我可能还需要提供更多关于这方面的背景。我最近收到了一台新电脑,并且一直在重新安装我的所有应用程序。当我打开我的网站后面的项目(运行良好)并运行它时,我收到一个错误,告诉我变量名不能包含空格。好的,我用括号修复了它,但后来想知道为什么这是我第一次看到这个错误。我调出正在运行的代码版本,发现变量名没有括起来。很奇怪,所以我想一个侧面的问题是为什么会这样。以下是我拥有的版本,如果它是相关的:

Microsoft Visual Studio 2010 版本 10.0.30319.1 RTMRel Microsoft .NET Framework 版本 4.0.30319 RTMRel 安装版本:专业版

以下是我收到的错误。由于这不是我可以逐步完成的(据我所知),我只想学习如何找到它。如果我能理解为什么这不是问题之前会很棒,因为我还没有改变任何东西!

*异常详细信息:System.FormatException:输入字符串的格式不正确。源错误:在执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪来识别有关异常起源和位置的信息。堆栈跟踪:[FormatException:输入字符串格式不正确。]
System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +9591147 System.Number.ParseInt32(String s, NumberStyles style , NumberFormatInfo info) +119
System.String.System.IConvertible.ToInt32(IFormatProvider provider) +46 System.Convert.ChangeType(Object value, TypeCode typeCode, IFormatProvider provider) +297
System.Web.UI.WebControls.Parameter.GetValue(Object value, String defaultValue, TypeCode type, Boolean convertEmptyStringToNull, Boolean ignoreNullableTypeChanges) +126
System.Web.UI.WebControls.Parameter.GetValue(Object value, Boolean ignoreNullableTypeChanges) +63
System .Web.UI.WebControls.Parameter.get_ParameterValue() +40
System.Web.UI.WebControls.ParameterCollection.GetValues(HttpContext context, Control control) +261
System.Web.UI.WebControls.SqlDataSourceView.InitializeParameters(DbCommand 命令, ParameterCollection参数,IDictionary excludeList) +266 System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +653
System.Web.UI.DataSourceView.Select(DataSourceSelectArguments 参数,DataSourceViewSelectCallback 回调) +21
System.Web.UI.WebControls.DataBoundControl.PerformSelect() +143
Telerik.Web.UI.GridTableView.PerformSelect() +38
System.Web. UI.WebControls.BaseDataBoundControl.DataBind() +74
Telerik.Web.UI.GridTableView.DataBind() +375
Telerik.Web.UI.RadGrid.DataBind() +173
System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +66
System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +75 System.Web.UI.Control.EnsureChildControls() +102 System.Web.UI.Control.PreRenderRecursiveInternal() +42
System.Web.UI.Control .PreRenderRecursiveInternal() +175
System.Web.UI.Control.PreRenderRecursiveInternal() +175
System.Web.UI.Control.PreRenderRecursiveInternal() +175
System.Web.UI.Control.PreRenderRecursiveInternal() +175
System.Web.UI.Page.ProcessRequestMain(布尔includeStagesBeforeAsyncPoint,布尔型 includeStagesAfterAsyncPoint) +2496*

感谢您提供的任何指导

达纳

4

2 回答 2

1

You couldn't hit this line because it's not your code. It didn't break in the markup because it was syntactically correct. It broke further down the line because the code was semantically incorrect.

于 2012-07-16T17:42:46.287 回答
0

I believe I found the problem causing the error. Turns out I did change something on one of the dropdowns and hadn't realized. Took my quite a while of commenting out code until I could isolate the problem.

Thanks to the helpful replies.

I'm still wondering why it was unable to point to the line causing the problem in the markup, like it does for the code-behind. No way to do that?

于 2012-07-16T17:39:18.477 回答