如果基础游标不可滚动,则 SQL Server Compact 不支持对 HasRows 属性的调用." [英] SQL Server Compact does not support calls to HasRows property if the underlying cursor is not scrollable."

查看:35
本文介绍了如果基础游标不可滚动,则 SQL Server Compact 不支持对 HasRows 属性的调用."的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这实际上意味着什么?

我正在逐步执行一些代码,当我在 vs2010 的本地窗口下查看数据读取器的属性时,DR.HasRows 显示错误:

I am stepping through some code and when I look at the properties of my datareader under the locals window in vs2010, the DR.HasRows shows an error:

HasRows '(DR).HasRows' threw an exception of   type 'System.InvalidOperationException'  bool {System.InvalidOperationException}

base    {"SQL Server Compact does not support calls to HasRows property if the underlying cursor is not scrollable."}   System.SystemException {System.InvalidOperationException}

什么是游标以及如何使其可滚动?:)

WHat is a cursor and how do I make it scrollable? :)

推荐答案

我之前遇到过这个错误,这是解决方案:

I got this error before and this is the solution:

bool hasRow = DR.Read();
if(hasRow)
 {
    //TODO
 }

这篇关于如果基础游标不可滚动,则 SQL Server Compact 不支持对 HasRows 属性的调用."的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆