# SQL Support

SQL support in the PPJ Framework is one of its strongest areas. It's fully driver independent and it relies on standard ADO.NET interfaces. It can work in two modes: Connected and Disconnected. The disconnected mode corresponds to having the ResultSet mode enabled in CTD. Bind and into variables and expressions are also fully supported and executed extremely fast.

## Database Configuration

CTD used the SQL.INI file to associate a data source name to a particular database. We use the sql.config file (in XML format) to associate a data source name to a specific ADO.NET driver and connection string. See [Configuration](/general/framework/sql-support/configuration.md).

## ResultSet mode

When ResultSet mode is off, the SQL layer in the PPJ Framework uses the fast ADO.NET's DataReader objects to scroll the result set, forward only. This is the connected mode and requires the connection to the database to be kept alive.

When ResultSet mode is on, the PPJ Framework uses ADO.NET's DataSet class to load the entire result set in memory (which also allows the code to scroll the result set backward) when the statement is executed.

## Multiple Active Result Sets (MARS)

The PPJ Framework is ready for both ADO.NET drivers, the ones that support MARS and the ones that don't. When an ADO.NET driver supports MARS, it is possible to execute "nested" sql statements without losing the previous result set. When MARS is not supported, it can be simulated by turning ResultSet mode on, or by enabling the multiple connection flag.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.iceteagroup.com/general/framework/sql-support.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
