Update db2

This commit is contained in:
sunkaixuan
2025-06-03 08:53:26 +08:00
parent 2ae7734801
commit a5f8aebd8e
2 changed files with 3 additions and 3 deletions

View File

@@ -438,9 +438,9 @@ namespace SqlSugar.DB2
private string GetSchema()
{
var schema = "db2inst1";
if (System.Text.RegularExpressions.Regex.IsMatch(this.Context.CurrentConnectionConfig.ConnectionString.ToLower(), "database="))
if (System.Text.RegularExpressions.Regex.IsMatch(this.Context.CurrentConnectionConfig.ConnectionString, "currentschema=", System.Text.RegularExpressions.RegexOptions.IgnoreCase))
{
var regValue = System.Text.RegularExpressions.Regex.Match(this.Context.CurrentConnectionConfig.ConnectionString.ToLower(), @"database\=(\w+)").Groups[1].Value;
var regValue = System.Text.RegularExpressions.Regex.Match(this.Context.CurrentConnectionConfig.ConnectionString, @"currentschema\=(\w+)", System.Text.RegularExpressions.RegexOptions.IgnoreCase).Groups[1].Value;
if (regValue.HasValue())
{
schema = regValue;