mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-29 10:49:36 +08:00
-
This commit is contained in:
parent
5c95784cac
commit
bd5078e73f
@ -34,7 +34,7 @@ namespace SqlSugar
|
||||
{
|
||||
get
|
||||
{
|
||||
return ErrorMessage.GetThrowMessage("Connection open error . {0}", " 连接字符串出错了,实在找不到原因请先Google错误.{0}.");
|
||||
return ErrorMessage.GetThrowMessage("Connection open error . {0}", " 连接字符串出错了,实在找不到原因请先Google错误{0}.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -17,12 +17,19 @@ namespace SqlSugar
|
||||
{
|
||||
if (base._DbConnection == null)
|
||||
{
|
||||
var mySqlConnectionString = base.Context.CurrentConnectionConfig.ConnectionString;
|
||||
if (!mySqlConnectionString.ToLower().Contains("charset"))
|
||||
try
|
||||
{
|
||||
mySqlConnectionString=mySqlConnectionString.Trim().TrimEnd(';') + ";charset=utf8;";
|
||||
var mySqlConnectionString = base.Context.CurrentConnectionConfig.ConnectionString;
|
||||
if (!mySqlConnectionString.ToLower().Contains("charset"))
|
||||
{
|
||||
mySqlConnectionString = mySqlConnectionString.Trim().TrimEnd(';') + ";charset=utf8;";
|
||||
}
|
||||
base._DbConnection = new MySqlConnection(mySqlConnectionString);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Check.Exception(true, ErrorMessage.ConnnectionOpen, ex.Message);
|
||||
}
|
||||
base._DbConnection = new MySqlConnection(mySqlConnectionString);
|
||||
}
|
||||
return base._DbConnection;
|
||||
}
|
||||
|
@ -22,9 +22,17 @@ namespace SqlSugar
|
||||
{
|
||||
get
|
||||
{
|
||||
if (base._DbConnection == null)
|
||||
try
|
||||
{
|
||||
base._DbConnection = new OracleConnection(base.Context.CurrentConnectionConfig.ConnectionString);
|
||||
if (base._DbConnection == null)
|
||||
{
|
||||
base._DbConnection = new OracleConnection(base.Context.CurrentConnectionConfig.ConnectionString);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
Check.Exception(true, ErrorMessage.ConnnectionOpen, ex.Message);
|
||||
}
|
||||
return base._DbConnection;
|
||||
}
|
||||
|
@ -16,7 +16,14 @@ namespace SqlSugar
|
||||
{
|
||||
if (base._DbConnection == null)
|
||||
{
|
||||
base._DbConnection = new SqlConnection(base.Context.CurrentConnectionConfig.ConnectionString);
|
||||
try
|
||||
{
|
||||
base._DbConnection = new SqlConnection(base.Context.CurrentConnectionConfig.ConnectionString);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Check.Exception(true, ErrorMessage.ConnnectionOpen, ex.Message);
|
||||
}
|
||||
}
|
||||
return base._DbConnection;
|
||||
}
|
||||
|
@ -17,8 +17,15 @@ namespace SqlSugar
|
||||
{
|
||||
if (base._DbConnection == null)
|
||||
{
|
||||
var SQLiteConnectionString = base.Context.CurrentConnectionConfig.ConnectionString;
|
||||
base._DbConnection = new SQLiteConnection(SQLiteConnectionString);
|
||||
try
|
||||
{
|
||||
var SQLiteConnectionString = base.Context.CurrentConnectionConfig.ConnectionString;
|
||||
base._DbConnection = new SQLiteConnection(SQLiteConnectionString);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Check.Exception(true, ErrorMessage.ConnnectionOpen, ex.Message);
|
||||
}
|
||||
}
|
||||
return base._DbConnection;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user