Skip to content

Commit fdec9f1

Browse files
committed
Update migration documentation.
1 parent d183228 commit fdec9f1

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

docs/content/tutorials/migrating-from-connector-net.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,24 @@ Migrating from Connector/NET
1616
MySqlConnector supports the same core API as MySQL Connector/NET, but the classes are in a different
1717
namespace. Change `using MySql.Data.MySqlClient;` to `using MySqlConnector;`.
1818

19+
### DbProviderFactories
20+
21+
The `MySqlClientFactory` type is named `MySqlConnectorFactory` in MySqlConnector.
22+
23+
In a .NET Framework application, make the following `app.config` change to register MySqlConnector instead of MySql.Data.
24+
25+
```xml
26+
<system.data>
27+
<DbProviderFactories>
28+
<!-- REMOVE THIS -->
29+
<!-- add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=8.0.20.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" / -->
30+
31+
<!-- ADD THIS -->
32+
<add name="MySqlConnector" invariant="MySqlConnector" description="MySQL Connector for .NET" type="MySqlConnector.MySqlConnectorFactory, MySqlConnector, Culture=neutral, PublicKeyToken=d33d3e53aa5f8c92" />
33+
</DbProviderFactories>
34+
</system.data>
35+
```
36+
1937
### Connection String Differences
2038

2139
MySqlConnector has some different default connection string options:
@@ -112,6 +130,10 @@ The return value of `MySqlConnection.BeginTransactionAsync` has changed from `Ta
112130
`ValueTask<MySqlTransaction>` to match the [standard API in .NET Core 3.0](https://github.com/dotnet/corefx/issues/35012).
113131
(This method does always perform I/O, so `ValueTask` is not an optimization for MySqlConnector.)
114132

133+
### MySqlConnectionStringBuilder
134+
135+
All `string` properties on `MySqlConnectionStringBuilder` will return the empty string (instead of `null`) if the property isn't set.
136+
115137
### MySqlCommand
116138

117139
Connector/NET allows a command to be executed even when `MySqlCommand.Transaction` references a commited, rolled back, or

0 commit comments

Comments
 (0)