Solved

SQL Server 2014 ADO

Posted on 2014-10-01
5
197 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
  • 2
  • 2
5 Comments
 
LVL 74

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
 

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 74

Accepted Solution

by:
käµfm³d   👽 earned 500 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
 

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

706 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now