diff --git a/Src/Asp.Net/SqlSugar/Abstract/AdoProvider/AdoProvider.cs b/Src/Asp.Net/SqlSugar/Abstract/AdoProvider/AdoProvider.cs index eea7a539f..9d92cd5e7 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/AdoProvider/AdoProvider.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/AdoProvider/AdoProvider.cs @@ -730,7 +730,7 @@ namespace SqlSugar private void SetConnectionEnd(string sql) { - if (this.IsMasterSlaveSeparation && IsRead(sql)) + if (this.IsMasterSlaveSeparation && IsRead(sql)&&this.Transaction==null) { this.Connection = this.MasterConnection; this.Context.CurrentConnectionConfig.ConnectionString = this.MasterConnection.ConnectionString;