mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-05-03 20:27:56 +08:00
-
This commit is contained in:
parent
2cf85ba888
commit
54b082e75b
@ -226,6 +226,8 @@ namespace SqlSugar
|
||||
|
||||
#region Core
|
||||
public virtual int ExecuteCommand(string sql, params SugarParameter[] parameters)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (this.ProcessingEventStartingSQL != null)
|
||||
ExecuteProcessingSQL(ref sql, parameters);
|
||||
@ -235,9 +237,17 @@ namespace SqlSugar
|
||||
if (this.IsClearParameters)
|
||||
sqlCommand.Parameters.Clear();
|
||||
ExecuteAfter(sql, parameters);
|
||||
if (this.IsClose()) this.Close();
|
||||
return count;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw ex;
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (this.IsClose()) this.Close();
|
||||
}
|
||||
}
|
||||
public virtual IDataReader GetDataReader(string sql, params SugarParameter[] parameters)
|
||||
{
|
||||
var isSp = this.CommandType == CommandType.StoredProcedure;
|
||||
@ -254,6 +264,8 @@ namespace SqlSugar
|
||||
return sqlDataReader;
|
||||
}
|
||||
public virtual DataSet GetDataSetAll(string sql, params SugarParameter[] parameters)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (this.ProcessingEventStartingSQL != null)
|
||||
ExecuteProcessingSQL(ref sql, parameters);
|
||||
@ -266,10 +278,20 @@ namespace SqlSugar
|
||||
if (this.IsClearParameters)
|
||||
sqlCommand.Parameters.Clear();
|
||||
ExecuteAfter(sql, parameters);
|
||||
if (this.IsClose()) this.Close();
|
||||
return ds;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw ex;
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (this.IsClose()) this.Close();
|
||||
}
|
||||
}
|
||||
public virtual object GetScalar(string sql, params SugarParameter[] parameters)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (this.ProcessingEventStartingSQL != null)
|
||||
ExecuteProcessingSQL(ref sql, parameters);
|
||||
@ -280,9 +302,17 @@ namespace SqlSugar
|
||||
if (this.IsClearParameters)
|
||||
sqlCommand.Parameters.Clear();
|
||||
ExecuteAfter(sql, parameters);
|
||||
if (this.IsClose()) this.Close();
|
||||
return scalar;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw ex;
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (this.IsClose()) this.Close();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
Loading…
Reference in New Issue
Block a user