mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-18 20:08:15 +08:00
- 增加 FreeSql.Provider.OracleOledb 解决US7ASCII 中文乱码问题;
This commit is contained in:
@ -1,11 +1,9 @@
|
||||
using FreeSql.Internal;
|
||||
using FreeSql.Internal.Model;
|
||||
using Oracle.ManagedDataAccess.Client;
|
||||
using FreeSql.Internal.ObjectPool;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Data.Common;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
|
||||
namespace FreeSql.Oracle
|
||||
@ -63,8 +61,13 @@ namespace FreeSql.Oracle
|
||||
|
||||
public override DbCommand CreateCommand()
|
||||
{
|
||||
var cmd = new OracleCommand();
|
||||
var cmd =
|
||||
#if oledb
|
||||
new System.Data.OleDb.OleDbCommand();
|
||||
#else
|
||||
new Oracle.ManagedDataAccess.Client.OracleCommand();
|
||||
cmd.BindByName = true;
|
||||
#endif
|
||||
return cmd;
|
||||
}
|
||||
|
||||
|
@ -1,11 +1,15 @@
|
||||
using Oracle.ManagedDataAccess.Client;
|
||||
#if oledb
|
||||
using System.Data.OleDb;
|
||||
using OracleException = System.Data.OleDb.OleDbException;
|
||||
using OracleConnection = System.Data.OleDb.OleDbConnection;
|
||||
#else
|
||||
using Oracle.ManagedDataAccess.Client;
|
||||
#endif
|
||||
using FreeSql.Internal.ObjectPool;
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.Common;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
@ -121,7 +125,10 @@ namespace FreeSql.Oracle
|
||||
public void OnDestroy(DbConnection obj)
|
||||
{
|
||||
try { if (obj.State != ConnectionState.Closed) obj.Close(); } catch { }
|
||||
#if oledb
|
||||
#else
|
||||
try { OracleConnection.ClearPool(obj as OracleConnection); } catch { }
|
||||
#endif
|
||||
obj.Dispose();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user