Documentation Home
MySQL Connector/NET Developer Guide
Related Documentation Download this Manual

MySQL Connector/NET Developer Guide  /  Connector/NET Programming  /  Using the Connector/NET with Prepared Statements

5.7 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 prepapared statements (they are disabled by default) by passing in "IgnorePrepare=false" to your connection string.

User Comments
User comments in this section are, as the name implies, provided by MySQL users. The MySQL documentation team is not responsible for, nor do they endorse, any of the information provided here.
Sign Up Login You must be logged in to post a comment.