程序从SQL server数据库中读数据时,有张数据表会出现这个问题。代码没有问题,不知道哪里出问题了。来问各位大大提错信息如下:
“/”应用程序中的服务器错误。
--------------------------------------------------------------------------------在 Range 对象中,Min (12)必须小于或等于 max (-1)。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.ArgumentException: 在 Range 对象中,Min (12)必须小于或等于 max (-1)。源错误:
行 462: expression = " ItemID= " + itemID;
行 463: //选出某一个项目的所有值
行 464: drs = valueDataSet.Tables[0].Select(expression);
行 465: if (drs.Length > 0)
行 466: {
源文件: E:\work\Yearbook\Yearbook.Web\Stat\StatDatum.aspx.cs 行: 464 堆栈跟踪:
[ArgumentException: 在 Range 对象中,Min (12)必须小于或等于 max (-1)。]
System.Data.Select.GetBinaryFilteredRecords() +1436311
System.Data.Select.SelectRows() +370
System.Data.DataTable.Select(String filterExpression) +68
Yearbook.Web.Stat.StatDatum.FillEconomyExponentTable() in E:\work\Yearbook\Yearbook.Web\Stat\StatDatum.aspx.cs:464
Yearbook.Web.Stat.StatDatum.EconomyExponentRadioButton_CheckedChanged(Object sender, EventArgs e) in E:\work\Yearbook\Yearbook.Web\Stat\StatDatum.aspx.cs:3957
System.Web.UI.WebControls.CheckBox.OnCheckedChanged(EventArgs e) +111
System.Web.UI.WebControls.RadioButton.RaisePostDataChangedEvent() +134
System.Web.UI.WebControls.RadioButton.System.Web.UI.IPostBackDataHandler.RaisePostDataChangedEvent() +10
System.Web.UI.Page.RaiseChangedEvents() +165
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1485
--------------------------------------------------------------------------------
版本信息: Microsoft .NET Framework 版本:2.0.50727.3074; ASP.NET 版本:2.0.50727.3074
“/”应用程序中的服务器错误。
--------------------------------------------------------------------------------在 Range 对象中,Min (12)必须小于或等于 max (-1)。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.ArgumentException: 在 Range 对象中,Min (12)必须小于或等于 max (-1)。源错误:
行 462: expression = " ItemID= " + itemID;
行 463: //选出某一个项目的所有值
行 464: drs = valueDataSet.Tables[0].Select(expression);
行 465: if (drs.Length > 0)
行 466: {
源文件: E:\work\Yearbook\Yearbook.Web\Stat\StatDatum.aspx.cs 行: 464 堆栈跟踪:
[ArgumentException: 在 Range 对象中,Min (12)必须小于或等于 max (-1)。]
System.Data.Select.GetBinaryFilteredRecords() +1436311
System.Data.Select.SelectRows() +370
System.Data.DataTable.Select(String filterExpression) +68
Yearbook.Web.Stat.StatDatum.FillEconomyExponentTable() in E:\work\Yearbook\Yearbook.Web\Stat\StatDatum.aspx.cs:464
Yearbook.Web.Stat.StatDatum.EconomyExponentRadioButton_CheckedChanged(Object sender, EventArgs e) in E:\work\Yearbook\Yearbook.Web\Stat\StatDatum.aspx.cs:3957
System.Web.UI.WebControls.CheckBox.OnCheckedChanged(EventArgs e) +111
System.Web.UI.WebControls.RadioButton.RaisePostDataChangedEvent() +134
System.Web.UI.WebControls.RadioButton.System.Web.UI.IPostBackDataHandler.RaisePostDataChangedEvent() +10
System.Web.UI.Page.RaiseChangedEvents() +165
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1485
--------------------------------------------------------------------------------
版本信息: Microsoft .NET Framework 版本:2.0.50727.3074; ASP.NET 版本:2.0.50727.3074
可能获得数据本来应该 Min (12)<= max (-1)。 但实际获得数据结果 Min (12)> max (-1),所有报错了
Dt.Select("ProductName='"+productNmae+"'");ok 数据库中的字段是 varchar2 的