查询的时候出现错误
“/”应用程序中的服务器错误。
calsses_id
说明: 执行当前 Web 请求期间,出现未经处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.IndexOutOfRangeException: calsses_id
源错误:
行 17: public IList<Calsses> GetAllClasses()
行 18: {
行 19: return SqlMap.QueryForList<Calsses>("SelectAllClasses", null);
行 20: }
行 21: /// <summary>
源文件: c:\Users\qq\Downloads\IbatisDemo01\BLLService\ClassesService.cs 行: 19
堆栈跟踪:
[IndexOutOfRangeException: calsses_id]
System.Data.ProviderBase.FieldNameLookup.GetOrdinal(String fieldName) +5328314
System.Data.SqlClient.SqlDataReader.GetOrdinal(String name) +61
IBatisNet.DataMapper.Commands.DataReaderDecorator.System.Data.IDataRecord.GetOrdinal(String name) +11
IBatisNet.DataMapper.TypeHandlers.Int32TypeHandler.GetValueByName(ResultProperty mapping, IDataReader dataReader) +19
IBatisNet.DataMapper.Configuration.ResultMapping.ResultProperty.GetDataBaseValue(IDataReader dataReader) +35
IBatisNet.DataMapper.MappedStatements.PropertyStrategy.DefaultStrategy.Get(RequestScope request, IResultMap resultMap, ResultProperty mapping, Object& target, IDataReader reader) +251
IBatisNet.DataMapper.MappedStatements.PropertyStrategy.DefaultStrategy.Set(RequestScope request, IResultMap resultMap, ResultProperty mapping, Object& target, IDataReader reader, Object keys) +26
IBatisNet.DataMapper.MappedStatements.ResultStrategy.ResultMapStrategy.Process(RequestScope request, IDataReader& reader, Object resultObject) +252
IBatisNet.DataMapper.MappedStatements.ResultStrategy.MapStrategy.Process(RequestScope request, IDataReader& reader, Object resultObject) +105
IBatisNet.DataMapper.MappedStatements.MappedStatement.RunQueryForList(RequestScope request, ISqlMapSession session, Object parameterObject, IList`1 resultObject, RowDelegate`1 rowDelegate) +453
IBatisNet.DataMapper.MappedStatements.MappedStatement.ExecuteQueryForList(ISqlMapSession session, Object parameterObject) +108
IBatisNet.DataMapper.SqlMapper.QueryForList(String statementName, Object parameterObject) +181
BLLService.ClassesService.GetAllClasses() in c:\Users\qq\Downloads\IbatisDemo01\BLLService\ClassesService.cs:19
IbatisDemo01.TestPage.BindData() in c:\Users\qq\Downloads\IbatisDemo01\IbatisDemo01\TestPage.aspx.cs:25
IbatisDemo01.TestPage.Page_Load(Object sender, EventArgs e) in c:\Users\qq\Downloads\IbatisDemo01\IbatisDemo01\TestPage.aspx.cs:20
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +51
System.Web.UI.Control.OnLoad(EventArgs e) +92
System.Web.UI.Control.LoadRecursive() +54
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +772
版本信息: Microsoft .NET Framework 版本:4.0.30319; ASP.NET 版本:4.0.30319.18408 asp.net??gridview
[解决办法]
异常详细信息: System.IndexOutOfRangeException: calsses_id 索引越界了。
你单步调试进你的方法体内部看看。
[解决办法]
System.Data.ProviderBase.FieldNameLookup.GetOrdinal(String fieldName) +5328314
没有找到calsses_id 这个字段