Chapter 5 Connector/Net Programming

Table of Contents

5.1 Connecting to MySQL Using Connector/Net
5.1.1 Creating a Connector/Net Connection String
5.1.2 Handling Connection Errors
5.1.3 Using GetSchema on a Connection
5.2 Using MySqlCommand
5.3 Using Connector/Net with Connection Pooling
5.4 Using the Windows Native Authentication Plugin
5.5 Writing a Custom Authentication Plugin
5.6 Using Connector/Net with Table Caching
5.7 Using the Connector/Net with Prepared Statements
5.7.1 Preparing Statements in Connector/Net
5.8 Accessing Stored Procedures with Connector/Net
5.8.1 Using Stored Routines from Connector/Net
5.9 Handling BLOB Data With Connector/Net
5.9.1 Preparing the MySQL Server
5.9.2 Writing a File to the Database
5.9.3 Reading a BLOB from the Database to a File on Disk
5.10 Asynchronous Methods
5.11 Using the Connector/Net Interceptor Classes
5.12 Handling Date and Time Information in Connector/Net
5.12.1 Fractional Seconds
5.12.2 Problems when Using Invalid Dates
5.12.3 Restricting Invalid Dates
5.12.4 Handling Invalid Dates
5.12.5 Handling NULL Dates
5.13 Using the MySqlBulkLoader Class
5.14 Using the MySQL Connector/Net Trace Source Object
5.14.1 Viewing MySQL Trace Information
5.14.2 Building Custom Listeners
5.15 Binary/Nonbinary Issues
5.16 Character Set Considerations for Connector/Net
5.17 Using Connector/Net with Crystal Reports
5.17.1 Creating a Data Source
5.17.2 Creating the Report
5.17.3 Displaying the Report
5.18 ASP.NET Provider Model
5.19 Working with Partial Trust / Medium Trust
5.19.1 Evolution of Partial Trust Support Across Connector/Net Versions
5.19.2 Configuring Partial Trust with Connector/Net Library Installed in GAC
5.19.3 Configuring Partial Trust with Connector/Net Library Not Installed in GAC

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:

In the following sections, you will learn about some common use cases for Connector/Net, including BLOB handling, date handling, and using Connector/Net with common tools such as Crystal Reports.