Universal class that can run any SQL SELECT query and return the resulting rows in 'pages' that contain a certain amount of rows. Especially useful for Find screens, but also for other screens where a lot of data is requested but might never be fully accessed.
More...
|
| TPagedDataSet (DataTable ATypedTable) |
| Runs a SQL SELECT query and returns the first 'page' containing a certain amount of rows. More...
|
|
void | ExecuteQuery (string AConfigFileName, string ASessionID, string AContext=null, TDataBase ADataBase=null) |
| Executes the query. Always call this method in a separate Thread to execute the query asynchronously! More...
|
|
void | ExecuteQueryDirectly (string AContext=null, TDataBase ADataBase=null) |
| Executes the query directly. not in a separate thread. without progress tracker. More...
|
|
DataTable | GetData (Int16 APage, Int16 APageSize) |
| Returns a DataTable for the requested 'Page'. More...
|
|
DataTable | GetAllData () |
| Returns all data that was found by executing the SQL SELECT Statement. More...
|
|
Universal class that can run any SQL SELECT query and return the resulting rows in 'pages' that contain a certain amount of rows. Especially useful for Find screens, but also for other screens where a lot of data is requested but might never be fully accessed.
Execution of the query can happen asynchronously by executing ExecuteQuery in a separate Thread!
◆ TPagedDataSet()
Ict.Petra.Server.MCommon.TPagedDataSet.TPagedDataSet |
( |
DataTable |
ATypedTable | ) |
|
|
inline |
Runs a SQL SELECT query and returns the first 'page' containing a certain amount of rows.
- See also
- For an example of how to use this class: look at the Ict.Petra.Server.MPartner.Partner.UIConnectors.TPartnerFindUIConnector class.
- Parameters
-
ATypedTable | if you want the result to be a typed datatable, you need to specify the type here, otherwise just pass new DataTable() |
- Returns
- void
◆ ExecuteQuery()
void Ict.Petra.Server.MCommon.TPagedDataSet.ExecuteQuery |
( |
string |
AConfigFileName, |
|
|
string |
ASessionID, |
|
|
string |
AContext = null , |
|
|
TDataBase |
ADataBase = null |
|
) |
| |
|
inline |
Executes the query. Always call this method in a separate Thread to execute the query asynchronously!
- Parameters
-
AConfigFileName | path to the config file |
ASessionID | the id of the current session |
AContext | Context in which this quite generic Method gets called (e.g. 'Partner Find'). This is optional but should be specified to aid in debugging as it gets logged in case Exceptions happen when the DB Transaction is taken out and the Query gets executed. |
ADataBase | An instantiated TDataBase object, or null (default = null). If null gets passed then the Method executes DB commands with a new Database connection |
An instance of TAsyncFindParameters with set up Properties must exist before this procedure can get called!
◆ ExecuteQueryDirectly()
void Ict.Petra.Server.MCommon.TPagedDataSet.ExecuteQueryDirectly |
( |
string |
AContext = null , |
|
|
TDataBase |
ADataBase = null |
|
) |
| |
|
inline |
Executes the query directly. not in a separate thread. without progress tracker.
- Parameters
-
AContext | Context in which this quite generic Method gets called (e.g. 'Partner Find'). This is optional but should be specified to aid in debugging as it gets logged in case Exceptions happen when the DB Transaction is taken out and the Query gets executed. |
ADataBase | An instantiated TDataBase object, or null (default = null). If null gets passed then the Method executes DB commands with a new Database connection |
An instance of TAsyncFindParameters with set up Properties must exist before this procedure can get called!
◆ GetAllData()
DataTable Ict.Petra.Server.MCommon.TPagedDataSet.GetAllData |
( |
| ) |
|
|
inline |
Returns all data that was found by executing the SQL SELECT Statement.
ExecuteQuery (or ExecuteFullQuery) needs to be called before to execute the SQL SELECT Statement to be able to return data.
- Returns
- DataTable holding all data that was found by executing the SQL SELECT Statement. This is an copy of the TPagedDataSet's internal DataTable, so the caller is free to do with it what it wants without affecting the internal DataTable of the TPagedDataSet.
◆ GetData()
DataTable Ict.Petra.Server.MCommon.TPagedDataSet.GetData |
( |
Int16 |
APage, |
|
|
Int16 |
APageSize |
|
) |
| |
|
inline |
Returns a DataTable for the requested 'Page'.
ExecuteQuery (or ExecuteFullQuery) needs to be called before to execute the SQL SELECT Statement to be able to return data.
- Parameters
-
APage | The 'Page' that should be returned |
APageSize | Number of DataRows that a 'Page' should contain. |
- Returns
- DataTable containing 'PageSize' (or less if the 'TotalRecords' are less than that value) DataRows.
◆ FindParameters
◆ Progress
◆ TotalPages
System.Int16 Ict.Petra.Server.MCommon.TPagedDataSet.TotalPages |
|
get |
Returns the number of Pages that were created
◆ TotalRecords
System.Int32 Ict.Petra.Server.MCommon.TPagedDataSet.TotalRecords |
|
get |
Returns the number of records that was returned by the query
The documentation for this class was generated from the following file:
- csharp/ICT/Petra/Server/lib/MCommon/Main.cs