mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-15 01:25:40 -05:00
Addressing PR 14 feedback
This commit is contained in:
@@ -38,17 +38,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection
|
||||
|
||||
public ConnectionDetails ConnectionDetails { get; private set; }
|
||||
|
||||
public DbConnection SqlConnection { get; private set; }
|
||||
|
||||
public void OpenConnection()
|
||||
{
|
||||
// build the connection string from the input parameters
|
||||
string connectionString = ConnectionService.BuildConnectionString(ConnectionDetails);
|
||||
|
||||
// create a sql connection instance
|
||||
SqlConnection = Factory.CreateSqlConnection(connectionString);
|
||||
SqlConnection.Open();
|
||||
}
|
||||
public DbConnection SqlConnection { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -170,7 +160,12 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection
|
||||
var response = new ConnectResponse();
|
||||
try
|
||||
{
|
||||
connectionInfo.OpenConnection();
|
||||
// build the connection string from the input parameters
|
||||
string connectionString = ConnectionService.BuildConnectionString(connectionInfo.ConnectionDetails);
|
||||
|
||||
// create a sql connection instance
|
||||
connectionInfo.SqlConnection = connectionInfo.Factory.CreateSqlConnection(connectionString);
|
||||
connectionInfo.SqlConnection.Open();
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user