mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-05 17:37:58 +08:00
Update access bug
This commit is contained in:
parent
524637c2d7
commit
6e9dcadc86
@ -74,9 +74,10 @@ namespace OrmTest
|
||||
var dt = db.Ado.GetDataTable("select 1");
|
||||
|
||||
//Create tables
|
||||
db.CodeFirst.InitTables(typeof(OrderItem),typeof(Order));
|
||||
Console.WriteLine(db.CurrentConnectionConfig.IsAutoCloseConnection);
|
||||
db.CodeFirst.InitTables(typeof(OrderItem));
|
||||
var id = db.Insertable(new Order() { Name = "order1", CustomId = 1, Price = 0, CreateTime = DateTime.Now }).ExecuteReturnIdentity();
|
||||
|
||||
Console.WriteLine(db.CurrentConnectionConfig.IsAutoCloseConnection);
|
||||
//Insert data
|
||||
db.Insertable(new OrderItem() { OrderId = id, Price = 0, CreateTime=DateTime.Now }).ExecuteCommand();
|
||||
Console.WriteLine("#### SqlSugarClient End ####");
|
||||
|
BIN
Src/Asp.Net/AccessTest/Test.laccdb
Normal file
BIN
Src/Asp.Net/AccessTest/Test.laccdb
Normal file
Binary file not shown.
@ -341,7 +341,7 @@ namespace SqlSugar.Access
|
||||
|
||||
private void Close(bool isOpen)
|
||||
{
|
||||
if (this.Context.CurrentConnectionConfig.IsAutoCloseConnection = true && isOpen)
|
||||
if (this.Context.CurrentConnectionConfig.IsAutoCloseConnection&& isOpen)
|
||||
{
|
||||
this.Context.Ado.Connection.Close();
|
||||
}
|
||||
@ -350,7 +350,7 @@ namespace SqlSugar.Access
|
||||
private bool Open()
|
||||
{
|
||||
var isOpen = false;
|
||||
if (this.Context.CurrentConnectionConfig.IsAutoCloseConnection = true && this.Context.Ado.Connection.State == ConnectionState.Closed)
|
||||
if (this.Context.CurrentConnectionConfig.IsAutoCloseConnection&& this.Context.Ado.Connection.State == ConnectionState.Closed)
|
||||
{
|
||||
this.Context.Ado.Connection.Open();
|
||||
isOpen = true;
|
||||
|
Loading…
Reference in New Issue
Block a user