oracle & mysql 驅動程式安裝配置

网络来者發表於2024-08-20



Install-Package Oracle.ManagedDataAccess -Version 12.2.20230118 版本可以安裝到19.18


Install-Package MySql.Data -Version 8.0.32.1


config檔案新增內容

<system.data>
<DbProviderFactories>
<remove invariant="MySql.Data.MySqlClient" />
<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.32.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />

<remove invariant="Oracle.ManagedDataAccess.Client" />
<add name="ODP.NET, Managed Driver" invariant="Oracle.ManagedDataAccess.Client" description="Oracle Data Provider for .NET, Managed Driver" type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.122.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />

</DbProviderFactories>
</system.data>


mysql驅動測試最小程式碼

FluentData.IDbContext jywms = new FluentData.DbContext().ConnectionString(@"host=10.8.1.140;database=nwms;uid = ***; pwd =***;charset=gb2312", new FluentData.MySqlProvider());
var cc = jywms.Sql("select now()").QuerySingle<DateTime>();
Console.WriteLine("資料庫時間 "+cc.ToString());
Console.ReadKey();



其他庫

Install-Package FluentData

Install-Package Masuit.Tools.Net

相關文章