Documentation Home
MySQL Connector/NET Developer Guide
Related Documentation Download this Manual
PDF (US Ltr) - 1.3Mb
PDF (A4) - 1.3Mb


MySQL Connector/NET Developer Guide  /  Connector/NET Programming

Chapter 5 Connector/NET Programming

Table of Contents

5.1 Using GetSchema on a Connection
5.2 Using MySqlCommand
5.3 Using Connector/NET with Table Caching
5.4 Preparing Statements in Connector/NET
5.5 Creating and Calling Stored Procedures
5.6 Handling BLOB Data With Connector/NET
5.6.1 Preparing the MySQL Server
5.6.2 Writing a File to the Database
5.6.3 Reading a BLOB from the Database to a File on Disk
5.7 Working with Partial Trust / Medium Trust
5.7.1 Evolution of Partial Trust Support Across Connector/NET Versions
5.7.2 Configuring Partial Trust with Connector/NET Library Installed in GAC
5.7.3 Configuring Partial Trust with Connector/NET Library Not Installed in GAC
5.8 Writing a Custom Authentication Plugin
5.9 Using the Connector/NET Interceptor Classes
5.10 Handling Date and Time Information in Connector/NET
5.10.1 Fractional Seconds
5.10.2 Problems when Using Invalid Dates
5.10.3 Restricting Invalid Dates
5.10.4 Handling Invalid Dates
5.10.5 Handling NULL Dates
5.11 Using the MySqlBulkLoader Class
5.12 Connector/NET Tracing
5.12.1 Enabling OpenTelemetry Tracing
5.12.2 Using the Connector/NET Trace Source Object
5.13 Using Connector/NET with Crystal Reports
5.13.1 Creating a Data Source
5.13.2 Creating the Report
5.13.3 Displaying the Report
5.14 Asynchronous Methods
5.15 Binary and Nonbinary Issues
5.16 Character Set Considerations for Connector/NET

MySQL Connector/NET comprises several classes that are used to connect to the database, execute queries and statements, and manage query results.

The following are the major classes of Connector/NET:

  • MySqlConnection: Represents an open connection to a MySQL database (seeChapter 4,Connector/NET Connections).

    TheMySqlConnectionStringBuilder class aids in the creation of a connection string by exposing the connection options as properties.

  • MySqlCommand: Represents an SQL statement to execute against a MySQL database.

  • MySqlCommandBuilder: Automatically generates single-table commands used to reconcile changes made to a DataSet with the associated MySQL database.

  • MySqlDataAdapter: Represents a set of data commands and a database connection that are used to fill a data set and update a MySQL database.

  • MySqlDataReader: Provides a means of reading a forward-only stream of rows from a MySQL database.

  • MySqlException: The exception that is thrown when MySQL returns an error.

  • MySqlHelper: Helper class that makes it easier to work with the provider.

  • MySqlTransaction: Represents an SQLtransaction to be made in a MySQL database.