mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-16 09:35:36 -05:00
Fixing the bug with connections on database make restore fail (#473)
* closing the connections that don't need to be open and keeping track of the connections that should stay open
This commit is contained in:
@@ -129,11 +129,13 @@ namespace Microsoft.SqlTools.ServiceLayer.Metadata
|
||||
ColumnMetadata[] metadata = null;
|
||||
if (connInfo != null)
|
||||
{
|
||||
SqlConnection sqlConn = ConnectionService.OpenSqlConnection(connInfo);
|
||||
TableMetadata table = new SmoMetadataFactory().GetObjectMetadata(
|
||||
sqlConn, metadataParams.Schema,
|
||||
metadataParams.ObjectName, objectType);
|
||||
metadata = table.Columns;
|
||||
using (SqlConnection sqlConn = ConnectionService.OpenSqlConnection(connInfo))
|
||||
{
|
||||
TableMetadata table = new SmoMetadataFactory().GetObjectMetadata(
|
||||
sqlConn, metadataParams.Schema,
|
||||
metadataParams.ObjectName, objectType);
|
||||
metadata = table.Columns;
|
||||
}
|
||||
}
|
||||
|
||||
await requestContext.SendResult(new TableMetadataResult
|
||||
|
||||
Reference in New Issue
Block a user