Documentation Home
MySQL Connector/Net Developer Guide
Related Documentation Download this Manual
PDF (US Ltr) - 2.6Mb
PDF (A4) - 2.6Mb
EPUB - 1.6Mb
HTML Download (TGZ) - 1.6Mb
HTML Download (Zip) - 1.6Mb

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

5.9 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 above.

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
Sign Up Login You must be logged in to post a comment.