mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-18 20:08:15 +08:00
- 修复 达梦某情况连接串解析 user id 问题;
This commit is contained in:
@ -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();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user