Update blueCopy

This commit is contained in:
skx 2020-10-22 19:16:15 +08:00
parent 8d3a6f8d65
commit bd8f269caf

View File

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