Browse Source

Update SqlServer CreateDatabasde

pull/3/head
sunkaixuna 3 years ago
parent
commit
9cd6283b3b
  1. 11
      Src/Asp.Net/SqlSugar/Realization/SqlServer/DbMaintenance/SqlServerDbMaintenance.cs

11
Src/Asp.Net/SqlSugar/Realization/SqlServer/DbMaintenance/SqlServerDbMaintenance.cs

@ -323,9 +323,16 @@ namespace SqlSugar
{
if (databaseDirectory != null)
{
if (!FileHelper.IsExistDirectory(databaseDirectory))
try
{
FileHelper.CreateDirectory(databaseDirectory);
if (!FileHelper.IsExistDirectory(databaseDirectory))
{
FileHelper.CreateDirectory(databaseDirectory);
}
}
catch
{
//Databases and sites are not in the same service
}
}
var oldDatabaseName = this.Context.Ado.Connection.Database;

Loading…
Cancel
Save