Comments
5 comments
-
Hi Eric,
That's interesting, those kinds of errors should be caught. With the API we're using there's no way to check whether a given instance is a Compact instance before connecting, however we should definitely handle this error a little better than we do. It should actually just get swallowed so I'm not sure why you're even seeing it.
Thanks,
Bart -
Swallowing would be a good first step but it will still freeze the UI at least 10 sec. each time. Would there be a way to flag a registered server so SQL Prompt ignores it?
Or, since those db are shown as [C:\...] in SSMS, a SQL Prompt option could be to ignore dbs with paths in their names. Quite crude, but efficient workaround if the elegant solution is expensive in time for the v3 release.
thanks,
Eric -
Hi Eric,
If you go into the Options dialog, then the Connections tab you'll see a grid at the bottom marked "Servers and Databases to Ignore". Just add your SQL Server 2005 Compact instance here. I'm not sure how Compact works but you should be able to just get away with the instance name, or if that doesn't work you can specify the database name as well.
Hope that helps.
Thanks,
Bart -
Hi Bart,
Ignoring the db works. Good enough workaround. Thanks!
Eric
Happy New Year!!
[/img] -
Great, thanks for letting me know Eric. Glad that sorted you out.
Cheers,
Bart
Add comment
Please sign in to leave a comment.
I would suggest just to skip SQL Compact support and not trying to connect 8)
If eventually Red-Gate products also supported SQL 2005 Compact since it is part of the SQL 2005 family, that would be incredible! Doing a compare, with all the syntax and other diffrences is not fun
In the mean time, just not trying to connect to those db types would be ok.
thanks
Eric
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.Data.SqlClient.SqlException: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Connect(Boolean& useFailoverPartner, Boolean& failoverDemandDone, String host, String failoverPartner, String protocol, SqlInternalConnectionTds connHandler, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject, Boolean aliasLookup)
at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup)
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.SqlClient.SqlConnection.Open()
at RedGate.SqlPrompt.Engine.ConnectionProperties.RetrieveServerDetails()
at RedGate.SqlPrompt.Engine.Cache.MetaDataCache._1(ConnectionProperties , IAuthenticationTokenProvider )
at RedGate.SqlPrompt.Engine.Cache.MetaDataCache.GetDatabase(ConnectionProperties conn, IAuthenticationTokenProvider provider, Boolean bleatIfBlacklisted)
at RedGate.SQLPrompt.CommonUI.Editor.EditorWindowBase.LoadDatabase()
at RedGate.SQLPrompt.CommonUI.Editor.EditorWindowBase.CheckConnectionChanged()
at _15.OnSetFocus(IVsTextView pView)