MySQL Connector/NET Developer Guide









ASP.NET Core - Connection String

ASP.NET Core. Connection String. Hans-Petter Halvorsen Using "SQL Server Authentication" the Connection String looks like this: ... SQL Server. Example ...
ASP.NET Core Connection String


ASP.NET Core Database Communication

SqlClient (or the newer. Microsoft.Data.SqlClient) is the provider or namespace you typically use to connect to an SQL. Server. • Typically we need to 
ASP.NET Core Database Communication


TIBCO Data Virtualization Client Interfaces Guide

15-Jul-2020 Examples Using ODBC to Connect to TDV Server. ... Connection String Options . ... NET Connection to a Client Restricted Server .
TIB tdv . . ClientInterfacesGuide ?id=


MySQL Connector/NET Developer Guide

4.1 Creating a Connector/NET Connection String . traditional SQL Server buttons in Visual Studio for keys indexes
connector net en





MySQL Connector/NET Developer Guide

string see Section 4.5
connector net en


On-site deployment

NET Core. Deploying Creatio .NET Core application. Deploy Microsoft SQL database for Creatio Modify ConnectionStrings.config for MS SQL Server.


SAP HANA Client Interface Programming Reference

22-Aug-2020 NET Core have separate SAP HANA providers in the ... For hdbsql connections the connection string must either explicitly reference the ...
SAP HANA Client Interface Programming Reference en


Modernize .NET Applications with Linux Containers

05-Aug-2021 Open the MvcMusicStore solution in Visual Studio. If using SQL Server Express in Web.config
modernize dotnet apps with linux containers





MySQL Connector/NET Developer Guide

4.1 Creating a Connector/NET Connection String . the traditional SQL Server buttons in Visual Studio for keys indexes
connector net en.a


Sitecore Experience Platform Upgrade Guide 10.0.0

20-Sept-2021 Since Sitecore XP 9.1.0 you can move security from the Core database to another database. • Add the security connection string


212863 MySQL Connector/NET Developer Guide

MySQL Connector/NET Developer Guide

Abstract

This manual describes how to install and configure MySQL Connector/NET, the connector that enables .NET

applications to communicate with MySQL servers, and how to use it to develop database applications.

For notes detailing the changes in each release of Connector/NET, see MySQL Connector/NET Release Notes.

For legal information, including licensing information, see the Preface and Legal Notices.

For help with using MySQL, please visit the MySQL Forums, where you can discuss your issues with other

MySQL users.

Document generated on: 2023-06-19 (revision: 75962)

Table of Contents

Preface and Legal Notices............................................................................................................v

1 Introduction to MySQL Connector/NET.......................................................................................1

2 Connector/NET Versions............................................................................................................3

3 Connector/NET Installation.........................................................................................................7

3.1 Installing Connector/NET on Windows.............................................................................7

3.1.1 Installing Connector/NET Using MySQL Installer....................................................7

3.1.2 Installing Connector/NET Using the Standalone Installer........................................8

3.1.3 Installing Connector/NET Using NuGet..................................................................8

3.2 Installing Connector/NET on Unix with Mono..................................................................10

3.3 Installing Connector/NET from Source...........................................................................11

4 Connector/NET Connections....................................................................................................13

4.1 Creating a Connector/NET Connection String.................................................................13

4.2 Managing a Connection Pool in Connector/NET.............................................................15

4.3 Handling Connection Errors...........................................................................................16

4.4 Connector/NET Authentication.......................................................................................17

4.5 Connector/NET Connection Options Reference..............................................................22

5 Connector/NET Programming...................................................................................................39

5.1 Using GetSchema on a Connection...............................................................................40

5.2 Using MySqlCommand..................................................................................................41

5.3 Using Connector/NET with Table Caching......................................................................44

5.4 Preparing Statements in Connector/NET........................................................................44

5.5 Creating and Calling Stored Procedures.........................................................................46

5.6 Handling BLOB Data With Connector/NET.....................................................................50

5.6.1 Preparing the MySQL Server..............................................................................50

5.6.2 Writing a File to the Database............................................................................50

5.6.3 Reading a BLOB from the Database to a File on Disk..........................................52

5.7 Working with Partial Trust / Medium Trust......................................................................53

5.7.1 Evolution of Partial Trust Support Across Connector/NET Versions.......................54

5.7.2 Configuring Partial Trust with Connector/NET Library Installed in GAC..................54

5.7.3 Configuring Partial Trust with Connector/NET Library Not Installed in GAC.............56

5.8 Writing a Custom Authentication Plugin..........................................................................56

5.9 Using the Connector/NET Interceptor Classes................................................................60

5.10 Handling Date and Time Information in Connector/NET.................................................61

5.10.1 Fractional Seconds...........................................................................................61

5.10.2 Problems when Using Invalid Dates..................................................................62

5.10.3 Restricting Invalid Dates...................................................................................62

5.10.4 Handling Invalid Dates......................................................................................62

5.10.5 Handling NULL Dates.......................................................................................62

5.11 Using the MySqlBulkLoader Class...............................................................................63

5.12 Using the Connector/NET Trace Source Object............................................................64

5.12.1 Viewing MySQL Trace Information....................................................................65

5.12.2 Building Custom Listeners................................................................................67

5.13 Using Connector/NET with Crystal Reports...................................................................69

5.13.1 Creating a Data Source....................................................................................69

5.13.2 Creating the Report..........................................................................................70

5.13.3 Displaying the Report.......................................................................................70

5.14 Asynchronous Methods...............................................................................................73

5.15 Binary and Nonbinary Issues.......................................................................................79

5.16 Character Set Considerations for Connector/NET.........................................................80

6 Connector/NET Tutorials..........................................................................................................81

6.1 Tutorial: An Introduction to Connector/NET Programming................................................81

6.1.1 The MySqlConnection Object..............................................................................81

6.1.2 The MySqlCommand Object...............................................................................82

6.1.3 Working with Decoupled Data.............................................................................84

6.1.4 Working with Parameters....................................................................................87

iii

MySQL Connector/NET Developer Guide6.1.5 Working with Stored Procedures.........................................................................88

6.2 ASP.NET Provider Model and Tutorials..........................................................................90

6.2.1 Tutorial: Connector/NET ASP.NET Membership and Role Provider.......................92

6.2.2 Tutorial: Connector/NET ASP.NET Profile Provider..............................................95

6.2.3 Tutorial: Web Parts Personalization Provider.......................................................97

MySQL Connector/NET Developer Guide

Abstract

This manual describes how to install and configure MySQL Connector/NET, the connector that enables .NET

applications to communicate with MySQL servers, and how to use it to develop database applications.

For notes detailing the changes in each release of Connector/NET, see MySQL Connector/NET Release Notes.

For legal information, including licensing information, see the Preface and Legal Notices.

For help with using MySQL, please visit the MySQL Forums, where you can discuss your issues with other

MySQL users.

Document generated on: 2023-06-19 (revision: 75962)

Table of Contents

Preface and Legal Notices............................................................................................................v

1 Introduction to MySQL Connector/NET.......................................................................................1

2 Connector/NET Versions............................................................................................................3

3 Connector/NET Installation.........................................................................................................7

3.1 Installing Connector/NET on Windows.............................................................................7

3.1.1 Installing Connector/NET Using MySQL Installer....................................................7

3.1.2 Installing Connector/NET Using the Standalone Installer........................................8

3.1.3 Installing Connector/NET Using NuGet..................................................................8

3.2 Installing Connector/NET on Unix with Mono..................................................................10

3.3 Installing Connector/NET from Source...........................................................................11

4 Connector/NET Connections....................................................................................................13

4.1 Creating a Connector/NET Connection String.................................................................13

4.2 Managing a Connection Pool in Connector/NET.............................................................15

4.3 Handling Connection Errors...........................................................................................16

4.4 Connector/NET Authentication.......................................................................................17

4.5 Connector/NET Connection Options Reference..............................................................22

5 Connector/NET Programming...................................................................................................39

5.1 Using GetSchema on a Connection...............................................................................40

5.2 Using MySqlCommand..................................................................................................41

5.3 Using Connector/NET with Table Caching......................................................................44

5.4 Preparing Statements in Connector/NET........................................................................44

5.5 Creating and Calling Stored Procedures.........................................................................46

5.6 Handling BLOB Data With Connector/NET.....................................................................50

5.6.1 Preparing the MySQL Server..............................................................................50

5.6.2 Writing a File to the Database............................................................................50

5.6.3 Reading a BLOB from the Database to a File on Disk..........................................52

5.7 Working with Partial Trust / Medium Trust......................................................................53

5.7.1 Evolution of Partial Trust Support Across Connector/NET Versions.......................54

5.7.2 Configuring Partial Trust with Connector/NET Library Installed in GAC..................54

5.7.3 Configuring Partial Trust with Connector/NET Library Not Installed in GAC.............56

5.8 Writing a Custom Authentication Plugin..........................................................................56

5.9 Using the Connector/NET Interceptor Classes................................................................60

5.10 Handling Date and Time Information in Connector/NET.................................................61

5.10.1 Fractional Seconds...........................................................................................61

5.10.2 Problems when Using Invalid Dates..................................................................62

5.10.3 Restricting Invalid Dates...................................................................................62

5.10.4 Handling Invalid Dates......................................................................................62

5.10.5 Handling NULL Dates.......................................................................................62

5.11 Using the MySqlBulkLoader Class...............................................................................63

5.12 Using the Connector/NET Trace Source Object............................................................64

5.12.1 Viewing MySQL Trace Information....................................................................65

5.12.2 Building Custom Listeners................................................................................67

5.13 Using Connector/NET with Crystal Reports...................................................................69

5.13.1 Creating a Data Source....................................................................................69

5.13.2 Creating the Report..........................................................................................70

5.13.3 Displaying the Report.......................................................................................70

5.14 Asynchronous Methods...............................................................................................73

5.15 Binary and Nonbinary Issues.......................................................................................79

5.16 Character Set Considerations for Connector/NET.........................................................80

6 Connector/NET Tutorials..........................................................................................................81

6.1 Tutorial: An Introduction to Connector/NET Programming................................................81

6.1.1 The MySqlConnection Object..............................................................................81

6.1.2 The MySqlCommand Object...............................................................................82

6.1.3 Working with Decoupled Data.............................................................................84

6.1.4 Working with Parameters....................................................................................87

iii

MySQL Connector/NET Developer Guide6.1.5 Working with Stored Procedures.........................................................................88

6.2 ASP.NET Provider Model and Tutorials..........................................................................90

6.2.1 Tutorial: Connector/NET ASP.NET Membership and Role Provider.......................92

6.2.2 Tutorial: Connector/NET ASP.NET Profile Provider..............................................95

6.2.3 Tutorial: Web Parts Personalization Provider.......................................................97