Class Result
Result object given by a
Query
performed on a database.
The typical pattern for using this class is to receive an instance of it as a result of using the
Database
and Query
class methods
that return a result. This class should not be initialised independently.
Note that this is a stub class that a driver will extend and complete as required for individual database types. Individual drivers could add additional methods, but this is discouraged to ensure that the API is the same for all database types.
Namespace: DataTables
Assembly: DataTables-Editor-Server.dll
Syntax
public abstract class Result : object
Constructors
| Improve this Doc View SourceResult(Database, System.Data.DataTable, Query)
Create a new result instance. Typically this should only be done by a
Query
method.
Declaration
protected Result(Database db, System.Data.DataTable dt, Query q)
Parameters
Type | Name | Description |
---|---|---|
Database | db | Database connection |
System.Data.DataTable | dt | Query results |
Query | q | Query |
Methods
| Improve this Doc View SourceCount()
Count the number of rows in the result set.
Declaration
public virtual int Count()
Returns
Type | Description |
---|---|
System.Int32 | Number of rows in the result set |
DataTable()
Get a DataTable of the results
Declaration
public System.Data.DataTable DataTable()
Returns
Type | Description |
---|---|
System.Data.DataTable | DataTable filled form the query result |
Fetch()
Get the next row in a result set
Declaration
public virtual Dictionary<string, object> Fetch()
Returns
Type | Description |
---|---|
Dictionary<System.String, System.Object> | Next row |
FetchAll()
Get all rows in the result set
Declaration
public virtual List<Dictionary<string, object>> FetchAll()
Returns
Type | Description |
---|---|
List<Dictionary<System.String, System.Object>> | The data for all rows |
InsertId()
After an INSERT query, get the ID that was inserted.
Declaration
public virtual string InsertId()
Returns
Type | Description |
---|---|
System.String | Insert id |