mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-05 17:37:58 +08:00
Update access
This commit is contained in:
parent
56571c99d5
commit
5fdf572da9
@ -28,7 +28,7 @@ namespace OrmTest
|
|||||||
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
|
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
|
||||||
{
|
{
|
||||||
ConnectionString = Config.ConnectionString,//Master Connection
|
ConnectionString = Config.ConnectionString,//Master Connection
|
||||||
DbType = DbType.SqlServer,
|
DbType = DbType.Access,
|
||||||
InitKeyType = InitKeyType.Attribute,
|
InitKeyType = InitKeyType.Attribute,
|
||||||
IsAutoCloseConnection = true,
|
IsAutoCloseConnection = true,
|
||||||
SlaveConnectionConfigs = new List<SlaveConnectionConfig>() {
|
SlaveConnectionConfigs = new List<SlaveConnectionConfig>() {
|
||||||
@ -53,7 +53,7 @@ namespace OrmTest
|
|||||||
Console.WriteLine("#### SqlSugarClient Start ####");
|
Console.WriteLine("#### SqlSugarClient Start ####");
|
||||||
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
|
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
|
||||||
{
|
{
|
||||||
DbType = DbType.SqlServer,
|
DbType = DbType.Access,
|
||||||
ConnectionString = Config.ConnectionString,
|
ConnectionString = Config.ConnectionString,
|
||||||
InitKeyType = InitKeyType.Attribute,
|
InitKeyType = InitKeyType.Attribute,
|
||||||
IsAutoCloseConnection = true,
|
IsAutoCloseConnection = true,
|
||||||
@ -146,7 +146,7 @@ namespace OrmTest
|
|||||||
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
|
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
|
||||||
{
|
{
|
||||||
ConnectionString = Config.ConnectionString,
|
ConnectionString = Config.ConnectionString,
|
||||||
DbType = DbType.SqlServer,
|
DbType = DbType.Access,
|
||||||
IsAutoCloseConnection = true,
|
IsAutoCloseConnection = true,
|
||||||
InitKeyType = InitKeyType.Attribute,
|
InitKeyType = InitKeyType.Attribute,
|
||||||
ConfigureExternalServices = new ConfigureExternalServices()
|
ConfigureExternalServices = new ConfigureExternalServices()
|
||||||
@ -209,7 +209,7 @@ namespace OrmTest
|
|||||||
new ConnectionConfig()
|
new ConnectionConfig()
|
||||||
{
|
{
|
||||||
ConfigId = 1,
|
ConfigId = 1,
|
||||||
DbType = DbType.SqlServer,
|
DbType = DbType.Access,
|
||||||
ConnectionString = Config.ConnectionString,
|
ConnectionString = Config.ConnectionString,
|
||||||
InitKeyType = InitKeyType.Attribute,
|
InitKeyType = InitKeyType.Attribute,
|
||||||
IsAutoCloseConnection = true,
|
IsAutoCloseConnection = true,
|
||||||
@ -226,8 +226,8 @@ namespace OrmTest
|
|||||||
Console.WriteLine("#### Distributed TransactionExample Start ####");
|
Console.WriteLine("#### Distributed TransactionExample Start ####");
|
||||||
SqlSugarClient db = new SqlSugarClient(new List<ConnectionConfig>()
|
SqlSugarClient db = new SqlSugarClient(new List<ConnectionConfig>()
|
||||||
{
|
{
|
||||||
new ConnectionConfig(){ ConfigId="1", DbType=DbType.SqlServer, ConnectionString=Config.ConnectionString,InitKeyType=InitKeyType.Attribute,IsAutoCloseConnection=true },
|
new ConnectionConfig(){ ConfigId="1", DbType=DbType.Access, ConnectionString=Config.ConnectionString,InitKeyType=InitKeyType.Attribute,IsAutoCloseConnection=true },
|
||||||
new ConnectionConfig(){ ConfigId="2", DbType=DbType.SqlServer, ConnectionString=Config.ConnectionString2 ,InitKeyType=InitKeyType.Attribute ,IsAutoCloseConnection=true}
|
new ConnectionConfig(){ ConfigId="2", DbType=DbType.Access, ConnectionString=Config.ConnectionString2 ,InitKeyType=InitKeyType.Attribute ,IsAutoCloseConnection=true}
|
||||||
});
|
});
|
||||||
|
|
||||||
//use db1
|
//use db1
|
||||||
@ -386,7 +386,7 @@ namespace OrmTest
|
|||||||
Db = new SqlSugarClient(new ConnectionConfig()
|
Db = new SqlSugarClient(new ConnectionConfig()
|
||||||
{
|
{
|
||||||
ConnectionString = Config.ConnectionString,
|
ConnectionString = Config.ConnectionString,
|
||||||
DbType = DbType.SqlServer,
|
DbType = DbType.Access,
|
||||||
IsAutoCloseConnection = true,
|
IsAutoCloseConnection = true,
|
||||||
InitKeyType = InitKeyType.Attribute,
|
InitKeyType = InitKeyType.Attribute,
|
||||||
AopEvents = new AopEvents()
|
AopEvents = new AopEvents()
|
||||||
@ -420,7 +420,7 @@ namespace OrmTest
|
|||||||
Db = new SqlSugarClient(new ConnectionConfig()
|
Db = new SqlSugarClient(new ConnectionConfig()
|
||||||
{
|
{
|
||||||
ConnectionString = Config.ConnectionString,
|
ConnectionString = Config.ConnectionString,
|
||||||
DbType = DbType.SqlServer,
|
DbType = DbType.Access,
|
||||||
IsAutoCloseConnection = true,
|
IsAutoCloseConnection = true,
|
||||||
InitKeyType = InitKeyType.Attribute,
|
InitKeyType = InitKeyType.Attribute,
|
||||||
AopEvents = new AopEvents()
|
AopEvents = new AopEvents()
|
||||||
|
@ -553,7 +553,7 @@ namespace OrmTest
|
|||||||
{
|
{
|
||||||
return new SqlSugarClient(new ConnectionConfig()
|
return new SqlSugarClient(new ConnectionConfig()
|
||||||
{
|
{
|
||||||
DbType = SqlSugar.DbType.SqlServer,
|
DbType = SqlSugar.DbType.Access,
|
||||||
ConnectionString = Config.ConnectionString,
|
ConnectionString = Config.ConnectionString,
|
||||||
InitKeyType = InitKeyType.Attribute,
|
InitKeyType = InitKeyType.Attribute,
|
||||||
IsAutoCloseConnection = true,
|
IsAutoCloseConnection = true,
|
||||||
|
@ -16,7 +16,7 @@ namespace OrmTest
|
|||||||
|
|
||||||
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
|
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
|
||||||
{
|
{
|
||||||
DbType = DbType.SqlServer,
|
DbType = DbType.Access,
|
||||||
ConnectionString = Config.ConnectionString,
|
ConnectionString = Config.ConnectionString,
|
||||||
InitKeyType = InitKeyType.Attribute,
|
InitKeyType = InitKeyType.Attribute,
|
||||||
IsAutoCloseConnection = true,
|
IsAutoCloseConnection = true,
|
||||||
|
@ -16,7 +16,7 @@ namespace OrmTest
|
|||||||
|
|
||||||
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
|
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
|
||||||
{
|
{
|
||||||
DbType = DbType.SqlServer,
|
DbType = DbType.Access,
|
||||||
ConnectionString = Config.ConnectionString,
|
ConnectionString = Config.ConnectionString,
|
||||||
InitKeyType = InitKeyType.Attribute,
|
InitKeyType = InitKeyType.Attribute,
|
||||||
IsAutoCloseConnection = true,
|
IsAutoCloseConnection = true,
|
||||||
|
@ -16,7 +16,7 @@ namespace OrmTest
|
|||||||
|
|
||||||
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
|
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
|
||||||
{
|
{
|
||||||
DbType = DbType.SqlServer,
|
DbType = DbType.Access,
|
||||||
ConnectionString = Config.ConnectionString,
|
ConnectionString = Config.ConnectionString,
|
||||||
InitKeyType = InitKeyType.Attribute,
|
InitKeyType = InitKeyType.Attribute,
|
||||||
IsAutoCloseConnection = true,
|
IsAutoCloseConnection = true,
|
||||||
|
@ -15,7 +15,7 @@ namespace OrmTest
|
|||||||
Console.WriteLine("#### SqlQueryable Start ####");
|
Console.WriteLine("#### SqlQueryable Start ####");
|
||||||
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
|
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
|
||||||
{
|
{
|
||||||
DbType = DbType.SqlServer,
|
DbType = DbType.Access,
|
||||||
ConnectionString = Config.ConnectionString,
|
ConnectionString = Config.ConnectionString,
|
||||||
InitKeyType = InitKeyType.Attribute,
|
InitKeyType = InitKeyType.Attribute,
|
||||||
IsAutoCloseConnection = true
|
IsAutoCloseConnection = true
|
||||||
|
@ -16,7 +16,7 @@ namespace OrmTest
|
|||||||
|
|
||||||
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
|
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
|
||||||
{
|
{
|
||||||
DbType = DbType.SqlServer,
|
DbType = DbType.Access,
|
||||||
ConnectionString = Config.ConnectionString,
|
ConnectionString = Config.ConnectionString,
|
||||||
InitKeyType = InitKeyType.Attribute,
|
InitKeyType = InitKeyType.Attribute,
|
||||||
IsAutoCloseConnection = true,
|
IsAutoCloseConnection = true,
|
||||||
|
@ -16,7 +16,7 @@ namespace OrmTest
|
|||||||
|
|
||||||
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
|
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
|
||||||
{
|
{
|
||||||
DbType = DbType.SqlServer,
|
DbType = DbType.Access,
|
||||||
ConnectionString = Config.ConnectionString,
|
ConnectionString = Config.ConnectionString,
|
||||||
InitKeyType = InitKeyType.Attribute,
|
InitKeyType = InitKeyType.Attribute,
|
||||||
IsAutoCloseConnection = true,
|
IsAutoCloseConnection = true,
|
||||||
|
@ -16,7 +16,7 @@ namespace OrmTest
|
|||||||
|
|
||||||
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
|
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
|
||||||
{
|
{
|
||||||
DbType = DbType.SqlServer,
|
DbType = DbType.Access,
|
||||||
ConnectionString = Config.ConnectionString,
|
ConnectionString = Config.ConnectionString,
|
||||||
InitKeyType = InitKeyType.Attribute,
|
InitKeyType = InitKeyType.Attribute,
|
||||||
IsAutoCloseConnection = true,
|
IsAutoCloseConnection = true,
|
||||||
|
@ -16,7 +16,7 @@ namespace OrmTest
|
|||||||
|
|
||||||
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
|
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
|
||||||
{
|
{
|
||||||
DbType = DbType.SqlServer,
|
DbType = DbType.Access,
|
||||||
ConnectionString = Config.ConnectionString,
|
ConnectionString = Config.ConnectionString,
|
||||||
InitKeyType = InitKeyType.Attribute,
|
InitKeyType = InitKeyType.Attribute,
|
||||||
IsAutoCloseConnection = true,
|
IsAutoCloseConnection = true,
|
||||||
|
@ -16,7 +16,7 @@ namespace OrmTest
|
|||||||
|
|
||||||
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
|
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
|
||||||
{
|
{
|
||||||
DbType = DbType.SqlServer,
|
DbType = DbType.Access,
|
||||||
ConnectionString = Config.ConnectionString,
|
ConnectionString = Config.ConnectionString,
|
||||||
InitKeyType = InitKeyType.Attribute,
|
InitKeyType = InitKeyType.Attribute,
|
||||||
IsAutoCloseConnection = true,
|
IsAutoCloseConnection = true,
|
||||||
|
@ -16,7 +16,7 @@ namespace OrmTest
|
|||||||
|
|
||||||
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
|
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
|
||||||
{
|
{
|
||||||
DbType = DbType.SqlServer,
|
DbType = DbType.Access,
|
||||||
ConnectionString = Config.ConnectionString,
|
ConnectionString = Config.ConnectionString,
|
||||||
InitKeyType = InitKeyType.Attribute,
|
InitKeyType = InitKeyType.Attribute,
|
||||||
IsAutoCloseConnection = true
|
IsAutoCloseConnection = true
|
||||||
|
@ -14,7 +14,7 @@ namespace OrmTest
|
|||||||
Console.WriteLine("#### DbFirst Start ####");
|
Console.WriteLine("#### DbFirst Start ####");
|
||||||
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
|
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
|
||||||
{
|
{
|
||||||
DbType = DbType.SqlServer,
|
DbType = DbType.Access,
|
||||||
ConnectionString = Config.ConnectionString,
|
ConnectionString = Config.ConnectionString,
|
||||||
InitKeyType = InitKeyType.Attribute,
|
InitKeyType = InitKeyType.Attribute,
|
||||||
IsAutoCloseConnection = true
|
IsAutoCloseConnection = true
|
||||||
|
@ -14,7 +14,7 @@ namespace OrmTest
|
|||||||
Console.WriteLine("#### CodeFirst Start ####");
|
Console.WriteLine("#### CodeFirst Start ####");
|
||||||
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
|
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
|
||||||
{
|
{
|
||||||
DbType = DbType.SqlServer,
|
DbType = DbType.Access,
|
||||||
ConnectionString = Config.ConnectionString3,
|
ConnectionString = Config.ConnectionString3,
|
||||||
InitKeyType = InitKeyType.Attribute,
|
InitKeyType = InitKeyType.Attribute,
|
||||||
IsAutoCloseConnection = true
|
IsAutoCloseConnection = true
|
||||||
|
@ -16,7 +16,7 @@ namespace OrmTest
|
|||||||
|
|
||||||
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
|
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
|
||||||
{
|
{
|
||||||
DbType = DbType.SqlServer,
|
DbType = DbType.Access,
|
||||||
ConnectionString = Config.ConnectionString,
|
ConnectionString = Config.ConnectionString,
|
||||||
InitKeyType = InitKeyType.Attribute,
|
InitKeyType = InitKeyType.Attribute,
|
||||||
IsAutoCloseConnection = true,
|
IsAutoCloseConnection = true,
|
||||||
|
@ -36,7 +36,7 @@ namespace OrmTest
|
|||||||
{
|
{
|
||||||
var db = new SqlSugarClient(new ConnectionConfig()
|
var db = new SqlSugarClient(new ConnectionConfig()
|
||||||
{
|
{
|
||||||
DbType = SqlSugar.DbType.SqlServer,
|
DbType = SqlSugar.DbType.Access,
|
||||||
InitKeyType = InitKeyType.Attribute,
|
InitKeyType = InitKeyType.Attribute,
|
||||||
IsAutoCloseConnection = true,
|
IsAutoCloseConnection = true,
|
||||||
ConnectionString = Config.ConnectionString
|
ConnectionString = Config.ConnectionString
|
||||||
|
@ -34,14 +34,14 @@ namespace OrmTest
|
|||||||
new ConnectionConfig()
|
new ConnectionConfig()
|
||||||
{
|
{
|
||||||
ConfigId="1",
|
ConfigId="1",
|
||||||
DbType = SqlSugar.DbType.SqlServer,
|
DbType = SqlSugar.DbType.Access,
|
||||||
IsAutoCloseConnection = true,
|
IsAutoCloseConnection = true,
|
||||||
ConnectionString = Config.ConnectionString
|
ConnectionString = Config.ConnectionString
|
||||||
},
|
},
|
||||||
new ConnectionConfig()
|
new ConnectionConfig()
|
||||||
{
|
{
|
||||||
ConfigId="2",
|
ConfigId="2",
|
||||||
DbType = SqlSugar.DbType.SqlServer,
|
DbType = SqlSugar.DbType.Access,
|
||||||
IsAutoCloseConnection = true,
|
IsAutoCloseConnection = true,
|
||||||
ConnectionString = Config.ConnectionString2
|
ConnectionString = Config.ConnectionString2
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@ namespace OrmTest
|
|||||||
|
|
||||||
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
|
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
|
||||||
{
|
{
|
||||||
DbType = DbType.SqlServer,
|
DbType = DbType.Access,
|
||||||
ConnectionString = Config.ConnectionString,
|
ConnectionString = Config.ConnectionString,
|
||||||
InitKeyType = InitKeyType.Attribute,
|
InitKeyType = InitKeyType.Attribute,
|
||||||
IsAutoCloseConnection = true,
|
IsAutoCloseConnection = true,
|
||||||
|
@ -16,7 +16,7 @@ namespace OrmTest
|
|||||||
|
|
||||||
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
|
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
|
||||||
{
|
{
|
||||||
DbType = DbType.SqlServer,
|
DbType = DbType.Access,
|
||||||
ConnectionString = Config.ConnectionString,
|
ConnectionString = Config.ConnectionString,
|
||||||
InitKeyType = InitKeyType.Attribute,
|
InitKeyType = InitKeyType.Attribute,
|
||||||
IsAutoCloseConnection = true,
|
IsAutoCloseConnection = true,
|
||||||
|
@ -33,7 +33,7 @@ namespace OrmTest
|
|||||||
{
|
{
|
||||||
public static SqlSugarScope Db = new SqlSugarScope(new ConnectionConfig()
|
public static SqlSugarScope Db = new SqlSugarScope(new ConnectionConfig()
|
||||||
{
|
{
|
||||||
DbType = SqlSugar.DbType.SqlServer,
|
DbType = SqlSugar.DbType.Access,
|
||||||
ConnectionString = Config.ConnectionString,
|
ConnectionString = Config.ConnectionString,
|
||||||
IsAutoCloseConnection = true
|
IsAutoCloseConnection = true
|
||||||
}, db => {
|
}, db => {
|
||||||
|
@ -15,7 +15,7 @@ namespace OrmTest
|
|||||||
Console.WriteLine("#### CodeFirst Start ####");
|
Console.WriteLine("#### CodeFirst Start ####");
|
||||||
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
|
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
|
||||||
{
|
{
|
||||||
DbType = DbType.SqlServer,
|
DbType = DbType.Access,
|
||||||
ConnectionString = Config.ConnectionString,
|
ConnectionString = Config.ConnectionString,
|
||||||
InitKeyType = InitKeyType.Attribute,
|
InitKeyType = InitKeyType.Attribute,
|
||||||
IsAutoCloseConnection = true
|
IsAutoCloseConnection = true
|
||||||
|
@ -95,7 +95,7 @@ namespace OrmTest
|
|||||||
|
|
||||||
public static SqlSugarClient GetInstance()
|
public static SqlSugarClient GetInstance()
|
||||||
{
|
{
|
||||||
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig() { DbType = DbType.SqlServer, ConnectionString = Config.ConnectionString, IsAutoCloseConnection = true });
|
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig() { DbType = DbType.Access, ConnectionString = Config.ConnectionString, IsAutoCloseConnection = true });
|
||||||
db.Aop.OnLogExecuted = (sql, p) =>
|
db.Aop.OnLogExecuted = (sql, p) =>
|
||||||
{
|
{
|
||||||
Console.WriteLine(sql);
|
Console.WriteLine(sql);
|
||||||
|
Loading…
Reference in New Issue
Block a user