DB2®ResultSet.CursorType Property
The type of cursor represented by the DB2ResultSet object.
- Namespace:
IBM.Data.DB2
- Assembly:
IBM.Data.DB2
(inIBM.Data.DB2.dll
)
Syntax
[Visual Basic]
Public Property CursorType As DB2CursorType
[C#]
public DB2CursorType CursorType {get}
[C++]
public: __property DB2CursorType* get_CursorType();
[JScript]
public function get CursorType() : DB2CursorType;
Property value
A DB2CursorType enumeration value.
Remarks
Depending on the data server your application is connected to, the type of cursor being used by a DB2ResultSet instance can be different than what the application assigned it to be in the DB2Command.ExecuteResultSet method. Use this property to verify the cursor type being used.
Example
[C#] The following example demonstrates how to find out what type of cursor is being used by the DB2ResultSet instance.
[C#]
public static string getSalesData(DB2Connection conn)
{
string salesQuery = "SELECT * FROM SALES";
string salesData = "";
DB2Command cmd = new DB2Command(salesQuery, conn);
DB2ResultSet salesRS = cmd.ExecuteResultSet(
DB2ResultSetOptions.Scrollable |
DB2ResultSetOptions.Sensitive |
DB2ResultSetOptions.SkipDeleted);
MessageBox.Show(salesRS.CursorType.ToString());
if (salesRS.ReadLast())
{
salesData = salesRS.GetDB2Date(0).ToString();
salesData += ", " + salesRS.GetDB2String(1).ToString();
salesData += ", " + salesRS.GetDB2String(2).ToString();
salesData += ", " + salesRS.GetDB2Int32(3).ToString();
}
return salesData;
}