mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-05 17:37:58 +08:00
Optimized error prompts
This commit is contained in:
parent
cdea7820d3
commit
308e931cee
@ -41,7 +41,7 @@ namespace OrmTest
|
||||
/// Database connection string
|
||||
/// 数据库连接字符串
|
||||
/// </summary>
|
||||
public readonly static string Connection = "server=.;uid=sa;pwd=sasa;database=SqlSugar5Demo";
|
||||
public readonly static string Connection = "server=.;uid=sa;pwd=sasa;database=SqlSugar5Demo;Encrypt=True;TrustServerCertificate=True";
|
||||
|
||||
/// <summary>
|
||||
/// Get a new SqlSugarClient instance with specific configurations
|
||||
|
@ -183,6 +183,10 @@ namespace SqlSugar
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (this.Context.CurrentConnectionConfig?.DbType==DbType.SqlServer&&ex.Message?.Contains("provider: SSL")==true)
|
||||
{
|
||||
Check.ExceptionEasy(true,ex.Message, "SSL出错,因为升级了驱动,字符串增加Encrypt=True;TrustServerCertificate=True;即可。详细错误:" + ex.Message);
|
||||
}
|
||||
Check.Exception(true, ErrorMessage.ConnnectionOpen, ex.Message+$"DbType=\"{this.Context.CurrentConnectionConfig.DbType}\";ConfigId=\"{this.Context.CurrentConnectionConfig.ConfigId}\"");
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user