Chapter 6 Connector/Net Programming

Table of Contents

6.1 Connecting to MySQL Using Connector/Net
6.2 Creating a Connector/Net Connection String
6.2.1 Opening a Connection
6.2.2 Handling Connection Errors
6.2.3 Using GetSchema on a Connection
6.3 Using MySqlCommand
6.4 Using Connector/Net with Connection Pooling
6.5 Using the Windows Native Authentication Plugin
6.6 Writing a Custom Authentication Plugin
6.7 Using Connector/Net with Table Caching
6.8 Using the Connector/Net with Prepared Statements
6.8.1 Preparing Statements in Connector/Net
6.9 Accessing Stored Procedures with Connector/Net
6.9.1 Using Stored Routines from Connector/Net
6.10 Handling BLOB Data With Connector/Net
6.10.1 Preparing the MySQL Server
6.10.2 Writing a File to the Database
6.10.3 Reading a BLOB from the Database to a File on Disk
6.11 Asynchronous methods
6.12 Using the Connector/Net Interceptor Classes
6.13 Handling Date and Time Information in Connector/Net
6.13.1 Fractional Seconds
6.13.2 Problems when Using Invalid Dates
6.13.3 Restricting Invalid Dates
6.13.4 Handling Invalid Dates
6.13.5 Handling NULL Dates
6.14 Using the MySqlBulkLoader Class
6.15 Using the MySQL Connector/Net Trace Source Object
6.15.1 Viewing MySQL Trace Information
6.15.2 Building Custom Listeners
6.16 Binary/Nonbinary Issues
6.17 Character Set Considerations for Connector/Net
6.18 Using Connector/Net with Crystal Reports
6.18.1 Creating a Data Source
6.18.2 Creating the Report
6.18.3 Displaying the Report
6.19 ASP.NET Provider Model
6.20 Working with Partial Trust / Medium Trust
6.20.1 Evolution of Partial Trust Support Across Connector/Net Versions
6.20.2 Configuring Partial Trust with Connector/Net Library Installed in GAC
6.20.3 Configuring Partial Trust with Connector/Net Library Not Installed in GAC

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.