Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

Loading of connection string with SQL Server Data Tools installed

$
0
0

Hi.

I use ServiceCache.ScriptFactory.CurrentlyActiveWndConnectionInfo (from Microsoft.SqlServer.SqlTools.VSIntegration.VS.dll assembly) to get connection string for currently opened tab.

The problem is that if SQL Server Data Tools is installed NullReferenceException will be generated in ServiceCache.ScriptFactory property.

Analyzed disassembled propery and found that service provider is null. The only ways to initialize it - use SQLWorkbenchPackage.SetSite or ServiceCache.Init methods. But in this case IServiceProvider should be implemented.

Tried to use ScriptFactory.Instance.CurrentlyActiveWndConnectionInfo (from SQLEditors.dll assembly). But COMException is generated - after disassembling found that it happens because current connection isn't found.

Guys, any thoughts? How can I load connection information when SSDT is installed?


Nickolay Laptev



Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>