Results 1 to 2 of 2

Thread: Why can't I pickup the server

  1. #1

    Thread Starter
    Fanatic Member venerable bede's Avatar
    Join Date
    Sep 2002
    Location
    The mystic land of Geordies
    Posts
    1,018

    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 ?

    Parksie

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    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.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width