Appearance
ExecuteReader Method
Definition
- Namespace:
JASE.Database - Assembly:
JASE.Database.dll
Reader ExecuteReader(string command, IReadOnlyList<IParameter> parameters = null, bool doFirstRead = null, bool allowBatch = null, CommandType commandType = null, bool enableReaderTracking = null, int commandTimeout = null)
csharp
Reader ExecuteReader(string command, IReadOnlyList<IParameter> parameters = null, bool doFirstRead = null, bool allowBatch = null, CommandType commandType = null, bool enableReaderTracking = null, int commandTimeout = null)Executes a database query and returns a Reader to read the results.
Parameters
| Name | Description |
|---|---|
allowBatch | If true, allows batch SQL statements; otherwise, throws if a batch is detected. |
command | The SQL command or stored procedure name to execute. |
commandTimeout | The command timeout in seconds, or -1 to use the default. |
commandType | The type of command (e.g., Text, StoredProcedure). |
doFirstRead | If true, reads the first row of the result set asynchronously. |
enableReaderTracking | If , tracks the returned Reader instance so it can be managed and disposed by the connection/session lifecycle; otherwise, the caller is solely responsible for disposing the reader. |
parameters | The parameters to bind to the command, if any. |
Returns
A Reader containing the query results.