Addressing feedback

This commit is contained in:
Mitchell Sternke
2016-09-06 17:10:55 -07:00
parent f6f59f3453
commit f5e40d7944
2 changed files with 15 additions and 8 deletions

View File

@@ -21,6 +21,15 @@ namespace Microsoft.SqlTools.ServiceLayer.QueryExecution
/// </summary>
public class Query : IDisposable
{
#region Constants
/// <summary>
/// "Error" code produced by SQL Server when the database context (name) for a connection changes.
/// </summary>
private const int DatabaseContextChangeErrorNumber = 5701;
#endregion
#region Properties
/// <summary>
@@ -146,10 +155,10 @@ namespace Microsoft.SqlTools.ServiceLayer.QueryExecution
{
await conn.OpenAsync();
if (conn.GetType() == typeof(SqlConnection))
SqlConnection sqlConn = conn as SqlConnection;
if (sqlConn != null)
{
// Subscribe to database informational messages
SqlConnection sqlConn = conn as SqlConnection;
sqlConn.InfoMessage += OnInfoMessage;
}
@@ -161,11 +170,6 @@ namespace Microsoft.SqlTools.ServiceLayer.QueryExecution
}
}
/// <summary>
/// "Error" code produced by SQL Server when the database context (name) for a connection changes.
/// </summary>
private const int DatabaseContextChangeErrorNumber = 5701;
/// <summary>
/// Handler for database messages during query execution
/// </summary>