Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

SQL Server 2014 ADO

Posted on 2014-10-01
5
Medium Priority
?
212 Views
1 Endorsement
Last Modified: 2014-10-05
I have tried to make a connection to a local install of SQL Server 2014 and get this

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)

   
 Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim conStr As String = "Server=localhost;Database=Marco;Trusted_Connection=True;"

        Dim conn As New SqlConnection(conStr)

        conn.Open()

    End Sub

Open in new window



I am having a problem with entity framework but though to go back to basics just to fault find.
1
Comment
Question by:Alyanto
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 40354381
Is the SQL Server service running?
0
 
LVL 24

Expert Comment

by:Phillip Burton
ID: 40354391
Is this a named instance? Is the SQL Server Browser Service running?
0
 
LVL 1

Author Comment

by:Alyanto
ID: 40354801
Yes it is running.  I suspect it might be a firewall issue even though it is a local database.
0
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 2000 total points
ID: 40354818
It shouldn't be if you're running locally. You can try turning off Windows Firewall to rule it out, though.
0
 
LVL 1

Author Closing Comment

by:Alyanto
ID: 40362155
I did the test as suggested and found that the connection began to work fine.  I then went onto add the port and other relevant details into the firewall white list and that has solved the problem.  This to say nothing short of a complete surprise to me that I had to do  this but a solution was wanted and found.  One detail that could have a small baring on this is that most of my C drive is compressed including windows.  I have an SSD and the performance change between compressed and uncompressed is negligible but it might have given the SQL Server setup and unrecorded problem.
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question