SQL Server Reporting Services LocalDB doesn't exist error - c#

I've been trying to view deployed reports in SSRS using Visual Studio 2015 and SQL Server 2014, but this is the error message I've been receiving:
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: SQL Network Interfaces, error: 50 - Local Database Runtime error occurred. The specified LocalDB instance does not exist. )
This is what my connection string looks like:
Data Source=(localdb)\VIRAJ-PC;Initial Catalog=AdventureWorks2012
I've done numerous things to troubleshoot this problem including editing the firewall settings to open ports 1433 and 1434 that need to be accessed, made sure that the MSSQLSERVER service was running, configured the local server to allow incoming connections, have turned on TCP/IP and Named Pipes protocols through the configuration manager, and have checked to see if the LocalDB instance is running through sqllocaldb.exe in the command line (it is running).
If it matters at all, I'm using SQL Server Management Studio 2016. I don't want to have to do an uninstall as I've done so two or three times already because of previous errors and have gone through a lot of configuration so if there's a way to fix this without having to just reinstall, I would appreciate it.

Related

Publish application and include .dbo and tables?

I am trying to publish my Windows forms application which uses a data connection (.dbo) for tables that run my application. However, when I publish the application, I get errors saying the application cannot access the SQL database.
I have looked through YouTube videos and read on the Windows website but I cannot really find anything that solves my problem. The server is a local server named after my laptop name. All of them talk about .mdf databases but I can only see a .dbo under data connections which includes all the tables I created for my application.
I get the following error:
"Unhandled exception has occurred in your application...
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 the instance name is correct and that SQL Server is configured to allow remote connection. (provider: Named Pipes Provider. error: 40 - Could not open a connection to SQL Server)"
It works fine when I run the .exe file on my computer where I built the application but the above error is given when I run the application on another computer.
Can anybody help me publish my application to include the .dbo and all tables?

Can't Connect to Azure SQL Server from Visual Studio Enterprise 2015

Okay, I am at a complete loss. I have set up a SQL server & database through Azure and have been trying to connect in Visual Studio. The database is listed under Azure in the Server Explorer in Visual Studio, but, when I try to open it in SQL Server Explorer, I get the following error when I try to connect:
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: TCP Provider, error: 0 - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.) (Microsoft SQL Server, Error: 10060)
I do not know what else to do. I have opened up port 1433 on my local firewall and allowed access from my computer's IP through the SQL Server's firewall. I temporarily opened it to all ip addresses, which did not work. The SQL Azure says the database is online. Is there an extra step or fix that I missed?
Connecting to your SQL Database would require you to allow it to be accessible from your IP first.
Please check this MS doc about how to do so.
By default Azure SQL DBs are exposed over the internet just with a simple username/password. Connecting from outside of Azure requires white-listing your IP.
The very simple way to do so is to connect using SQL Management Studio, which detects that and allows you to add you IP address automatically to the firewall rules. Have a look here to see how this works.
Update to include comments:
If none of this works, your problem probably has to do with from where you are trying to access it.
If you are behind a company firewall, there could be rules prohibiting connecting to certain port ranges. Try to connect from a wifi hotspot over your mobile phone is the quickest way to figure out.

ASP.NET bug with SQL Server [duplicate]

This question already has answers here:
Cannot Connect to Server - A network-related or instance-specific error
(54 answers)
Closed 6 years ago.
Got a SqlException.
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)
Trying to populate the screen with a list of Products.
The bug
It’s reading the connection string ok otherwise it would tell us. It’s configured to except remote connections.
This document claims to have an exhaustive log of troubleshooting steps. Every step we take below this link is related to it. We’re using SQL Server 2014. http://social.technet.microsoft.com/wiki/contents/articles/2102.how-to-troubleshoot-connecting-to-the-sql-server-database-engine.aspx
It didn’t help. I did everything.
Enabled remote connections.
I used ipconfig as admin in console to verify IP address and pinged
all of them and my computer with the ping command.
They all reported ok. Tested connecting to sql server from visual
studio using as example “tcp:ipv4/myInstance.” Which was read ok.
Reinstalled SQL Server 2014. Nothing.
I reinstalled the whole OS. Didn’t work.
If you require more explicit infomation please ask me, I'll give as much detail as I can.
If you are sure that the specified instance name is correct you can check the following in the Sql Server Configuration Manager:
Firstly, check under protocols in the nodes on the left:
And make sure that both TCP/IP and Named Pipes are enabled.
If this is disabled on any of these nodes connections to the SQL server will fail.
Also under SQL server Services, make sure the browser service is enabled.
Also, is the server and the pc you are connecting from the same pc?

Unable to publish ASP.NET database to external server

I'm trying to publish my ASP.NET MVC application to my server running Windows Server 2008.
I have installed IIS
I have created a database in on the (LocalDb)\v11.0 server on the destination server (The DB is named TestPublishWebApp).
I've clicked publish and have set the connection (and validated the connection):
And I have set the settings as well:
However whenever I publish the application I and go to the URL I get the following 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: SQL
Network Interfaces, error: 50 - Local Database Runtime error occurred.
Cannot create an automatic instance. See the Windows Application event
log for error details.
This is the very first time I'm trying to publish an application to an external server. What could I be doing wrong?
And yes, I have verified that the SQL server is running.

Network related error while deploying a window application & used database to another pc

My window application works fine on my computer but when I install it on another computer a network-related error occurred...
I'm using sql server 2005, I have store the backup of the database, when i run it, it flags an error.
I'm using visual studio 10, C#,sql sever 2005
Error is..
"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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)""
When this happens it means that the program cannot connect to SQL Server with information you provided.
If for example you are trying to connect my-server\sqlexpress, usually you have one of this issues:
There is no computer named my-server in your network!
SQL Server is not installed on my-server.
Your client computer cannot reach my-server from the network. You can check this using ping command.
The installed SQL Server instance name on my-server is not sqlexpress (case-insensitive).
You have not enabled TCP/IP protocol for your installation instance of SQL Server in "Sql Server Configuration Manager".
You have not restarted SQL Server service after enabling TCP/IP.
Your SQL Server instance is not default instance, and SQL Server Browser service is not running on the server.
Server's firewall is preventing the client to access the server. Try turning off the firewall on the server (only to test this case).
Consider this a checklist, and start from the beginning. Check them one by one. And I hope that you find the problem.

Categories