Skip to content

Commit

Permalink
Merge pull request #26 from jdeshin/Open
Browse files Browse the repository at this point in the history
Поправлен метод Open для возможности работы с ConnectionString для SQ…
  • Loading branch information
ret-Phoenix authored Apr 27, 2018
2 parents 4b6538f + f3c30df commit 4e5140e
Showing 1 changed file with 6 additions and 21 deletions.
27 changes: 6 additions & 21 deletions oscript-sql/DBConnector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -228,27 +228,12 @@ public bool Open()
{
if (DbType == (new EnumDBType()).sqlite)
{
string filePath = DbName;
if (filePath == string.Empty )
{
filePath = ConnectionString;
}
else
{
ConnectionString = filePath;
}
_connection = new SQLiteConnection(string.Format("Data Source={0};", filePath));
if (System.IO.File.Exists(DbName))
{
return OpenConnection();

}
else
{
Console.WriteLine("Create db: " + DbName);
_connection.Open();
return true;
}
if (ConnectionString == string.Empty && DbName != string.Empty)
ConnectionString = string.Format("Data Source={0};", DbName);

_connection = new SQLiteConnection(ConnectionString);

return OpenConnection();
}
else if (DbType == (new EnumDBType()).MSSQLServer)
{
Expand Down

0 comments on commit 4e5140e

Please sign in to comment.