Documentation Home
Connectors and APIs Manual
Download this Manual

Connectors and APIs Manual  /  ...  /  Using the Connector/NET with Prepared Statements

4.5.5 Using the Connector/NET with Prepared Statements

Use of prepared statements can provide significant performance improvements on queries that are executed more than once.


Prepared statement support is available with MySQL 4.1 and higher.

Prepared execution is faster than direct execution for statements executed more than once, primarily because the query is parsed only once. In the case of direct execution, the query is parsed every time it is executed. Prepared execution also can provide a reduction of network traffic because for each execution of the prepared statement, it is necessary only to send the data for the parameters.

Another advantage of prepared statements is that, with server-side prepared statements enabled, it uses a binary protocol that makes data transfer between client and server more efficient.


Enable server-side prepared statements (they are disabled by default) by passing in "IgnorePrepare=false" to your connection string.