I've read all of the related questions and none answer my situation. I am using Visual Studio 2005. I have not been able to connect to the remote SQL database at all. I have attempted to write a SMO to make the connection however, the info I have been able to get to on MSDN didn’t have enough information to carry me through.
Here is the code I found it on MSDN and have been attempting to use.
Module Module1
Sub Main()
Imports Microsoft.SqlServer.Management.Smo
Imports Microsoft.SqlServer.Management.Common
'Declare a ServerConnection object variable to specify SQL authentication, login and password.
Dim conn As New ServerConnection
conn.LoginSecure = False
conn.Login = xxxx
conn.Password = xxxxx
'Connect to the local, default instance of SQL Server.
Dim srv As Server
srv = New Server(conn)
'The actual connection is made when a property is retrieved.
Console.WriteLine(srv.Information.Version)
'The connection is automatically disconnected when the Server variable goes out of scope.
End Sub
End Module
The code executes however, nothing happens. I don’t know where the IP address comes into play. Thanks in advance.
· SQL Server 2005 Standard
· TCPIP
· Server not starting (I’m able to connect using SQL Server Management Studio
· I don’t know whether SQL Browser is enabled enabled. I use the IP address when using SQL Server Management Studio
· I’m not sure however, I believe it runs under Network Service with the Host provider
· I have not made a firewall exception
· Windows XPSP2
· Running Norton AntiVirus 2007
Thanks for any help or advice.
The conn object will takt the ip address if you want to connect with one of that to the server, then you probably do not nee the login and the password specified in the code as you can pass it with the connection string. (See connectionstrings.com for more information) If you want to specify the login and password within your application you can use the new Server("10.10.10.10") (as 10.10.10.10 is the IPAddress)
Jens K. Suessmeyer.
http://www.sqlserver2005.de
|||Thank yousql
No comments:
Post a Comment