没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
MySQL Connector/Net Developer Guide
Abstract
This manual describes how to install and configure MySQL Connector/Net, the driver 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, see the Legal Notices.
For help with using MySQL, please visit either the MySQL Forums or MySQL Mailing Lists, where you can discuss
your issues with other MySQL users.
For additional documentation on MySQL products, including translations of the documentation into other languages,
and downloadable versions in variety of formats, including HTML and PDF formats, see the MySQL Documentation
Library.
Licensing information. This product may include third-party software, used under license. If you are using
a Commercial release of MySQL Connector/Net, see this document for licensing information, including licensing
information relating to third-party software that may be included in this Commercial release. If you are using a
Community release of MySQL Connector/Net, see this document for licensing information, including licensing
information relating to third-party software that may be included in this Community release.
Document generated on: 2017-03-18 (revision: 51287)
iii
Table of Contents
Preface and Legal Notices ................................................................................................................ vii
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 ............................................... 7
3.2 Installing Connector/Net on Unix with Mono ......................................................................... 10
3.3 Installing Connector/Net from the Source Code .................................................................... 11
4 Connector/Net Tutorials ................................................................................................................. 13
4.1 Tutorial: An Introduction to Connector/Net Programming ....................................................... 13
4.1.1 The MySqlConnection Object ................................................................................... 13
4.1.2 The MySqlCommand Object ..................................................................................... 14
4.1.3 Working with Decoupled Data .................................................................................. 17
4.1.4 Working with Parameters ......................................................................................... 20
4.1.5 Working with Stored Procedures ............................................................................... 21
4.2 Tutorial: MySQL Connector/Net ASP.NET Membership and Role Provider ............................. 23
4.3 Tutorial: MySQL Connector/Net ASP.NET Profile Provider .................................................... 29
4.4 Tutorial: Web Parts Personalization Provider ....................................................................... 31
4.5 Tutorial: Simple Membership Web Provider ......................................................................... 35
4.5.1 Requirements .......................................................................................................... 35
4.5.2 Creating and Configuring a New Project ................................................................... 36
4.5.3 Adding OAuth Authentication to a Project ................................................................. 39
4.6 Tutorial: Using an Entity Framework Entity as a Windows Forms Data Source ........................ 42
4.7 Tutorial: Databinding in ASP.NET Using LINQ on Entities ..................................................... 56
4.8 Tutorial: Using SSL with MySQL Connector/Net ................................................................... 61
4.9 Tutorial: Using MySqlScript ................................................................................................. 63
4.9.1 Using Delimiters with MySqlScript ............................................................................. 65
4.10 Tutorial: Generating MySQL DDL from an Entity Framework Model ..................................... 67
5 Connector/Net Programming .......................................................................................................... 69
5.1 Connecting to MySQL Using Connector/Net ......................................................................... 70
5.2 Creating a Connector/Net Connection String ........................................................................ 70
5.2.1 Opening a Connection ............................................................................................. 70
5.2.2 Handling Connection Errors ...................................................................................... 72
5.2.3 Using GetSchema on a Connection .......................................................................... 73
5.3 Using MySqlCommand ....................................................................................................... 75
5.4 Using Connector/Net with Connection Pooling ..................................................................... 76
5.5 Using the Windows Native Authentication Plugin .................................................................. 77
5.6 Writing a Custom Authentication Plugin ............................................................................... 77
5.7 MySQL Fabric Support ....................................................................................................... 81
5.8 Using Connector/Net with Table Caching ............................................................................. 87
5.9 Using the Connector/Net with Prepared Statements ............................................................. 87
5.9.1 Preparing Statements in Connector/Net .................................................................... 87
5.10 Accessing Stored Procedures with Connector/Net .............................................................. 88
5.10.1 Using Stored Routines from Connector/Net ............................................................. 89
5.11 Handling BLOB Data With Connector/Net .......................................................................... 92
5.11.1 Preparing the MySQL Server .................................................................................. 92
5.11.2 Writing a File to the Database ................................................................................ 93
5.11.3 Reading a BLOB from the Database to a File on Disk .............................................. 95
5.12 Asynchronous methods ..................................................................................................... 96
5.13 Using the Connector/Net Interceptor Classes ................................................................... 102
MySQL Connector/Net Developer Guide
iv
5.14 Handling Date and Time Information in Connector/Net ...................................................... 104
5.14.1 Fractional Seconds ............................................................................................... 104
5.14.2 Problems when Using Invalid Dates ...................................................................... 105
5.14.3 Restricting Invalid Dates ....................................................................................... 105
5.14.4 Handling Invalid Dates ......................................................................................... 105
5.14.5 Handling NULL Dates ........................................................................................... 106
5.15 Using the MySqlBulkLoader Class ................................................................................... 106
5.16 Using the MySQL Connector/Net Trace Source Object ..................................................... 108
5.16.1 Viewing MySQL Trace Information ........................................................................ 109
5.16.2 Building Custom Listeners .................................................................................... 111
5.17 Binary/Nonbinary Issues .................................................................................................. 113
5.18 Character Set Considerations for Connector/Net ............................................................... 113
5.19 Using Connector/Net with Crystal Reports ........................................................................ 114
5.19.1 Creating a Data Source ........................................................................................ 114
5.19.2 Creating the Report .............................................................................................. 115
5.19.3 Displaying the Report ........................................................................................... 116
5.20 ASP.NET Provider Model ................................................................................................ 119
5.21 Working with Partial Trust / Medium Trust ........................................................................ 121
5.21.1 Evolution of Partial Trust Support Across Connector/Net Versions ........................... 121
5.21.2 Configuring Partial Trust with Connector/Net Library Installed in GAC ...................... 122
5.21.3 Configuring Partial Trust with Connector/Net Library Not Installed in GAC ................ 124
6 Connector/Net Connection String Options Reference .................................................................... 127
7 Connector/Net Support for Windows Store .................................................................................... 135
8 EF5 Support ................................................................................................................................ 137
9 EF6 Support ................................................................................................................................ 141
10 Connector/Net API Reference .................................................................................................... 147
10.1 MySql.Data.MySqlClient Namespace ............................................................................... 147
10.1.1 MySql.Data.MySqlClientHierarchy ......................................................................... 149
10.1.2 BaseCommandInterceptor Class ........................................................................... 149
10.1.3 BaseExceptionInterceptor Class ............................................................................ 149
10.1.4 MySqlCommand Class ......................................................................................... 150
10.1.5 MySqlCommandBuilder Class ............................................................................... 158
10.1.6 MySqlConnection Class ........................................................................................ 165
10.1.7 MySqlDataAdapter Class ...................................................................................... 173
10.1.8 MySqlDataReader Class ....................................................................................... 180
10.1.9 MySqlDbType Enumeration .................................................................................. 199
10.1.10 MySqlError Class ............................................................................................... 201
10.1.11 MySqlErrorCode Enumeration ............................................................................. 204
10.1.12 MySqlException Class ........................................................................................ 205
10.1.13 MySqlHelper Class ............................................................................................. 206
10.1.14 MySqlInfoMessageEventArgs Class .................................................................... 217
10.1.15 MySqlInfoMessageEventHandler Delegate ........................................................... 219
10.1.16 MySqlParameter Class ....................................................................................... 220
10.1.17 MySqlParameterCollection Class ......................................................................... 230
10.1.18 MySqlRowUpdatedEventArgs Class .................................................................... 244
10.1.19 MySqlRowUpdatedEventHandler Delegate ........................................................... 246
10.1.20 MySqlRowUpdatingEventArgs Class .................................................................... 247
10.1.21 MySqlRowUpdatingEventHandler Delegate .......................................................... 249
10.1.22 MySqlTransaction Class ..................................................................................... 250
10.2 MySql.Data.Types Namespace ........................................................................................ 252
10.2.1 MySql.Data.TypesHierarchy .................................................................................. 253
10.2.2 MySqlConversionException Class ......................................................................... 253
10.2.3 MySqlDateTime Structure ..................................................................................... 255
10.3 MySql.Data.MySqlClient.Memcached Namespace ............................................................ 260
MySQL Connector/Net Developer Guide
v
10.3.1 BinaryClient Class ................................................................................................ 260
10.3.2 Client Class ......................................................................................................... 261
10.3.3 TextClient Class ................................................................................................... 272
10.4 MySql.Data.MySqlClient.Replication Namespace .............................................................. 273
10.4.1 ReplicationManager Class .................................................................................... 273
10.4.2 ReplicationRoundRobinServerGroup Class ............................................................ 280
10.4.3 ReplicationServer Class ........................................................................................ 283
10.4.4 ReplicationServerGroup Class .............................................................................. 287
11 Connector/Net Support ............................................................................................................... 295
11.1 Connector/Net Community Support .................................................................................. 295
11.2 How to Report Connector/Net Problems or Bugs .............................................................. 295
12 Connector/Net FAQ ................................................................................................................... 297
剩余305页未读,继续阅读
资源评论
UNICORNLi
- 粉丝: 1
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功