Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 (中文) » SQL Anywhere 服务器 - 编程 » SQL Anywhere 数据访问 API » SQL Anywhere .NET 2.0 API 参考 » iAnywhere.Data.SQLAnywhere 命名空间 (.NET 2.0) » SADataReader 类

 

Read 方法

读取结果集的下一行,并将 SADataReader 移动到该行。

语法
Visual Basic

Public Overrides Function Read() As Boolean
C#

public override bool Read();
返回值

如果还有其它行,则返回 true。否则返回 false。

注释

SADataReader 的缺省位置是在第一个记录之前。因此,必须调用 Read 才能开始对任何数据进行访问。

示例

以下代码使用结果中一列的值填充列表框。

while( reader.Read() )
{
    listResults.Items.Add(
        reader.GetValue( 0 ).ToString() );
}
listResults.EndUpdate();
reader.Close();
另请参见