- 修复 达梦某情况连接串解析 user id 问题;

This commit is contained in:
2881099
2023-07-06 10:34:41 +08:00
parent b1f37b672c
commit 70036d4235
5 changed files with 6310 additions and 6085 deletions

View File

@ -34,8 +34,8 @@ namespace FreeSql.Dameng
public static string GetUserId(string connectionString)
{
var userIdMatch = Regex.Match(connectionString, @"(User\s+Id|Uid)\s*=\s*([^;]+)", RegexOptions.IgnoreCase);
if (userIdMatch.Success == false) throw new Exception(@"从 ConnectionString 中无法匹配 (User\s+Id|Uid)\s*=\s*([^;]+)");
var userIdMatch = Regex.Match(connectionString, @"(User\s+Id|Uid|User)\s*=\s*([^;]+)", RegexOptions.IgnoreCase);
if (userIdMatch.Success == false) throw new Exception(@"从 ConnectionString 中无法匹配 (User\s+Id|Uid|User)\s*=\s*([^;]+)");
return userIdMatch.Groups[2].Value.Trim().ToUpper();
}