@ -51,7 +51,15 @@ namespace SqlSugar
{
this.Context.Ado.Connection.Open();
}
try
bulkCopy.WriteToServer(dt);
catch (Exception ex)
this.Context.Ado.Connection.Close();
throw ex;
if (this.Context.CurrentConnectionConfig.IsAutoCloseConnection && this.Context.Ado.Transaction == null)