Update AdoProvider.cs

This commit is contained in:
sunkaixuan
2019-05-08 15:20:33 +08:00
parent 9a62ce5b65
commit 7878cd8f7c
9 changed files with 29 additions and 16 deletions

View File

@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OrmTest</RootNamespace>
<AssemblyName>OrmTest</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile />
@@ -23,6 +23,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -32,6 +33,7 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="SyntacticSugar, Version=2.4.1.0, Culture=neutral, processorArchitecture=MSIL">
@@ -154,7 +156,9 @@
<ItemGroup>
<Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<None Include="app.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

View File

@@ -2,6 +2,7 @@
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using System.Diagnostics;
using System.Linq;
@@ -178,9 +179,9 @@ namespace SqlSugar
#region abstract
public abstract IDataParameter[] ToIDbDataParameter(params SugarParameter[] pars);
public abstract void SetCommandToAdapter(IDataAdapter adapter, IDbCommand command);
public abstract void SetCommandToAdapter(IDataAdapter adapter, DbCommand command);
public abstract IDataAdapter GetAdapter();
public abstract IDbCommand GetCommand(string sql, SugarParameter[] pars);
public abstract DbCommand GetCommand(string sql, SugarParameter[] pars);
public abstract IDbConnection Connection { get; set; }
public abstract void BeginTran(string transactionName);//Only SqlServer
public abstract void BeginTran(IsolationLevel iso, string transactionName);//Only SqlServer
@@ -397,7 +398,7 @@ namespace SqlSugar
ExecuteProcessingSQL(ref sql, parameters);
ExecuteBefore(sql, parameters);
IDataAdapter dataAdapter = this.GetAdapter();
IDbCommand sqlCommand = GetCommand(sql, parameters);
DbCommand sqlCommand = GetCommand(sql, parameters);
this.SetCommandToAdapter(dataAdapter, sqlCommand);
DataSet ds = new DataSet();
dataAdapter.Fill(ds);

View File

@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using System.Linq;
using System.Reflection;
@@ -29,9 +30,9 @@ namespace SqlSugar
int CommandTimeOut { get; set; }
TimeSpan SqlExecutionTime { get; }
IDbBind DbBind { get; }
void SetCommandToAdapter(IDataAdapter adapter, IDbCommand command);
void SetCommandToAdapter(IDataAdapter adapter, DbCommand command);
IDataAdapter GetAdapter();
IDbCommand GetCommand(string sql, SugarParameter[] parameters);
DbCommand GetCommand(string sql, SugarParameter[] parameters);
DataTable GetDataTable(string sql, object parameters);
DataTable GetDataTable(string sql, params SugarParameter[] parameters);
DataTable GetDataTable(string sql, List<SugarParameter> parameters);

View File

@@ -2,6 +2,7 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
@@ -56,7 +57,7 @@ namespace SqlSugar
{
return new MySqlDataAdapter();
}
public override IDbCommand GetCommand(string sql, SugarParameter[] parameters)
public override DbCommand GetCommand(string sql, SugarParameter[] parameters)
{
MySqlCommand sqlCommand = new MySqlCommand(sql, (MySqlConnection)this.Connection);
sqlCommand.CommandType = this.CommandType;
@@ -73,7 +74,7 @@ namespace SqlSugar
CheckConnection();
return sqlCommand;
}
public override void SetCommandToAdapter(IDataAdapter dataAdapter, IDbCommand command)
public override void SetCommandToAdapter(IDataAdapter dataAdapter, DbCommand command)
{
((MySqlDataAdapter)dataAdapter).SelectCommand = (MySqlCommand)command;
}

View File

@@ -2,6 +2,7 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
@@ -80,7 +81,7 @@ namespace SqlSugar
{
return new OracleDataAdapter();
}
public override IDbCommand GetCommand(string sql, SugarParameter[] parameters)
public override DbCommand GetCommand(string sql, SugarParameter[] parameters)
{
OracleCommand sqlCommand = new OracleCommand(sql, (OracleConnection)this.Connection);
sqlCommand.BindByName = true;
@@ -98,7 +99,7 @@ namespace SqlSugar
CheckConnection();
return sqlCommand;
}
public override void SetCommandToAdapter(IDataAdapter dataAdapter, IDbCommand command)
public override void SetCommandToAdapter(IDataAdapter dataAdapter, DbCommand command)
{
((OracleDataAdapter)dataAdapter).SelectCommand = (OracleCommand)command;
}

View File

@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
@@ -55,7 +56,7 @@ namespace SqlSugar
{
return new SqlDataAdapter();
}
public override IDbCommand GetCommand(string sql, SugarParameter[] parameters)
public override DbCommand GetCommand(string sql, SugarParameter[] parameters)
{
SqlCommand sqlCommand = new SqlCommand(sql, (SqlConnection)this.Connection);
sqlCommand.CommandType = this.CommandType;
@@ -72,7 +73,7 @@ namespace SqlSugar
CheckConnection();
return sqlCommand;
}
public override void SetCommandToAdapter(IDataAdapter dataAdapter, IDbCommand command)
public override void SetCommandToAdapter(IDataAdapter dataAdapter, DbCommand command)
{
((SqlDataAdapter)dataAdapter).SelectCommand = (SqlCommand)command;
}

View File

@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using System.Data.SQLite;
using System.Linq;
@@ -52,7 +53,7 @@ namespace SqlSugar
{
return new SQLiteDataAdapter();
}
public override IDbCommand GetCommand(string sql, SugarParameter[] parameters)
public override DbCommand GetCommand(string sql, SugarParameter[] parameters)
{
SQLiteCommand sqlCommand = new SQLiteCommand(sql, (SQLiteConnection)this.Connection);
sqlCommand.CommandType = this.CommandType;
@@ -69,7 +70,7 @@ namespace SqlSugar
CheckConnection();
return sqlCommand;
}
public override void SetCommandToAdapter(IDataAdapter dataAdapter, IDbCommand command)
public override void SetCommandToAdapter(IDataAdapter dataAdapter, DbCommand command)
{
((SQLiteDataAdapter)dataAdapter).SelectCommand = (SQLiteCommand)command;
}

View File

@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SqlSugar</RootNamespace>
<AssemblyName>SqlSugar</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
@@ -21,6 +21,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -29,6 +30,7 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="MySql.Data, Version=6.2.1.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">