mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-24 18:04:52 +08:00
Add Check
This commit is contained in:
parent
160b8be79a
commit
b7215b7e83
@ -2,6 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace SqlSugar
|
||||
{
|
||||
@ -289,6 +290,7 @@ namespace SqlSugar
|
||||
}
|
||||
var oldDatabaseName = this.Context.Ado.Connection.Database;
|
||||
var connection = this.Context.CurrentConnectionConfig.ConnectionString;
|
||||
Check.Exception(Regex.Split(connection,oldDatabaseName).Length > 2, "The user name and password cannot be the same as the database name ");
|
||||
connection = connection.Replace(oldDatabaseName, "mysql");
|
||||
var newDb = new SqlSugarClient(new ConnectionConfig()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user