Why can't I pickup the server
I am using the following :
Code:
Dim svr As Server = New Server()
to create a server object. In this case it connects to the default local server which in my case is a sql server 2000 instance on my local machine.
I am trying to create a server object for my sqlExpress 2005 installation on my local machine but for the life of me cannot figure it out.
I have tried :
Code:
Dim svr As Server = New Server(@"MACHINENAME\SQLEXPRESS")
but i get no joy.
It always fails to connect.
What am I doing wrong ?
Re: Why can't I pickup the server
First up, what's the @ doing in there? This is VB, not C#.
Secondly, what's a Server? That's not a standard Framework class. Is it part of SMO? If so then it would be a good idea to say so.
Finally, what exactly happens? To say it fails to connect is not enough because there could be different reasons that would produce different results.
Remember these words: FULL and CLEAR. Provide a full and clear description from the outset to avoid wasting time with the back and forth and also so we don't need to guess or assume and thereby provide potentially irrelevant advice.