mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-10-15 18:55:07 +08:00
Update oledb bug
This commit is contained in:
@@ -301,7 +301,24 @@ namespace SqlSugar
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
string sql = _ExecuteReturnIdentity();
|
string sql = _ExecuteReturnIdentity();
|
||||||
var result =await Ado.GetIntAsync(sql, InsertBuilder.Parameters == null ? null : InsertBuilder.Parameters.ToArray());
|
var result = 0;
|
||||||
|
if (InsertBuilder.IsOleDb)
|
||||||
|
{
|
||||||
|
var isAuto = false;
|
||||||
|
if (this.Context.CurrentConnectionConfig.IsAutoCloseConnection)
|
||||||
|
{
|
||||||
|
isAuto = true;
|
||||||
|
this.Context.CurrentConnectionConfig.IsAutoCloseConnection = false;
|
||||||
|
}
|
||||||
|
result = Ado.GetInt(sql.Split(';').First(), InsertBuilder.Parameters == null ? null : InsertBuilder.Parameters.ToArray());
|
||||||
|
result = Ado.GetInt(sql.Split(';').Last(), InsertBuilder.Parameters == null ? null : InsertBuilder.Parameters.ToArray());
|
||||||
|
if (isAuto)
|
||||||
|
{
|
||||||
|
this.Ado.Close();
|
||||||
|
this.Context.CurrentConnectionConfig.IsAutoCloseConnection = isAuto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
result =await Ado.GetIntAsync(sql, InsertBuilder.Parameters == null ? null : InsertBuilder.Parameters.ToArray());
|
||||||
After(sql, result);
|
After(sql, result);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user