思归帮忙看下,[SqlException: 未能完成游标操作,因为在声明游标后,表架构有更改。]是什么错误。

cenxaoi 2006-07-24 05:28:34
我使用 sp_cursoropen 来实现分页操作。在da.Fill(Result);(Result是个DataSet类型。)有时会出现如下错误。但数据库服务重启就解决问题.特别是数据服务运行几个小时后,这个问题就一直出现.
sp_cursoropen详细在http://community.csdn.net/Expert/topic/4816/4816642.xml?temp=.2518274


堆栈跟踪:


[SqlException: 未能完成游标操作,因为在声明游标后,表架构有更改。]
System.Data.SqlClient.SqlDataReader.Read()
System.Data.Common.DbDataAdapter.FillLoadDataRow(SchemaMapping mapping)
System.Data.Common.DbDataAdapter.FillFromReader(Object data, String srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords, DataColumn parentChapterColumn, Object parentChapterValue)
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords)
System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
BoDa.UseerControls.Pager1.GetResult() in D:\Inetpub\wwwroot\tongcheng\UseerControls\Pager1.ascx.cs:161
BoDa.UseerControls.Pager1.DataBind(PagerEventArgs ce) in D:\Inetpub\wwwroot\tongcheng\UseerControls\Pager1.ascx.cs:130
BoDa.UseerControls.Pager1.DataBind() in D:\Inetpub\wwwroot\tongcheng\UseerControls\Pager1.ascx.cs:121
tongcheng.BatMan.advice.advice.rtadviceBind(String sql) in D:\Inetpub\wwwroot\tongcheng\BatMan\advice\advice.aspx.cs:99
tongcheng.BatMan.advice.advice.Page_Load(Object sender, EventArgs e) in D:\Inetpub\wwwroot\tongcheng\BatMan\advice\advice.aspx.cs:64
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()


这到底是什么问题,为什么有时出现有时不会.特别是sql语句使用嵌套子查询时,出现频率更高.
...全文
534 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
heilong05 2006-07-25
  • 打赏
  • 举报
回复
Mark



====CSDN 小助手 V2.5 2005年11月05日发布====
CSDN小助手是一款脱离浏览器也可以访问Csdn论坛的软件
界面:http://blog.csdn.net/Qqwwee_Com/archive/2005/11/05/523395.aspx
下载:http://szlawbook.com/csdnv2

孟子E章 2006-07-24
  • 打赏
  • 举报
回复
http://www.itpub.net/330610.html

110,499

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧