Results 1 to 6 of 6

Thread: VB 2010 Express Ed Sql error

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2009
    Posts
    233

    Resolved VB 2010 Express Ed Sql error

    hi guys, trying to get my hands wet on vs 2010 and i downloaded samples from ms site but when i tried to run some of the DB samples i received this sql error:

    A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

    any ideas how to get around on this? Thanks.
    The taller the bamboo grows the lower it bends...

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

    Re: VB 2010 Express Ed Sql error

    Have you installed SQL Server Express? You can't connect to it if you haven't installed it.
    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

  3. #3
    A SQL Server fool GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    7,493

    Re: VB 2010 Express Ed Sql error

    What is the connection string that you used?
    Sometimes the Programmer
    Sometimes the DBA

    Mazz1

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Jan 2009
    Posts
    233

    Re: VB 2010 Express Ed Sql error

    Quote Originally Posted by jmcilhinney View Post
    Have you installed SQL Server Express? You can't connect to it if you haven't installed it.
    Yes, it's installed.
    The taller the bamboo grows the lower it bends...

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Jan 2009
    Posts
    233

    Re: VB 2010 Express Ed Sql error

    Quote Originally Posted by GaryMazzone View Post
    What is the connection string that you used?
    Protected Const SqlConnectionString As String = _
    "Server=(local);" & _
    "DataBase=;" & _
    "Integrated Security=SSPI"

    Please help.. Thanks
    The taller the bamboo grows the lower it bends...

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

    Re: VB 2010 Express Ed Sql error

    You are trying to connect to a default instance. Did you install SQL Server Express as a default instance? Unless you changed that setting specifically, SQL Server Express would have installed as a named instance with the name "SQLExpress".

    http://www.connectionstrings.com/sql-server-2005
    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