April 13, 2007 at 10:26 am
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’ve been attempting to use.
Module Module1
Imports Microsoft.SqlServer.Management.Smo
Imports Microsoft.SqlServer.Management.Common
Sub Main()
'Declare a ServerConnection object variable to specify SQL authentication, login and password.
Dim conn As New ServerConnection
conn.LoginSecure = False
conn.Login = XXXXX
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
I really don’t know where this should go or how to cause it to make the connection. If anyone can help with the correct code or where I can find it I will appreciate it. Thanks in advance.
April 14, 2007 at 6:53 pm
In 2005 you have to use the surface area configuration tool to enable SQL Server to allow remote connections, all you need is covered in the link below by Microsoft. And no I don't use either SMO or DMO both are Microsoft property it changes as needed which is not in my best interest. Hope this helps.
http://support.microsoft.com/kb/914277
Kind regards,
Gift Peddie
April 14, 2007 at 9:50 pm
Thanks for the good help
April 15, 2007 at 5:53 am
I am glad I could help.
Kind regards,
Gift Peddie
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy