SQLExpress database file auto-creation error - after deploying to Azure - asp.net-mvc-4

Was going about with our usual deployment of code (ASP.NET MVC solution) to Azure to a test instance as an App service. The solution works on local machine, but started throwing this exception in Azure.
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)"
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
* SQLExpress database file auto-creation error: *
Unfortunately this seems to be happening even for other environments now. I haven't changed anything there except redeploying. This has nothing to do with connectionString, have triple checked it on the server itself. Basically the solution as it is works, and have been working for all this while, but since last week all new deployments are failing with this error. Even re-deploying the old code seems to fail. I am afraid to try it on any new environments.
No recent changes were made to web.config, all that was updated was some UI components. In any case, even the older code that is running on other environments are failing. Any ideas on why this could be happening?

SQLExpress only exists within Visual Studio. On something like Azure, you need a connection string that points to a real instance of a SQL Server database.

Related

I am getting an error 26 connection issue to SQL server

I created a datasource using the wizard, previewed the data, and everything looks good, all of the data is showing up. I attempt to use the fill method on the built in datagrid control, and it times out telling me
message=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)
Source=.Net SqlClient Data Provider
How can i preview the data, but then all of the sudden when the application actually starts, i cant access the server at all?
I was compiling and running my project from a mapped network drive, and i tried EVERYTHING i had permissions to try to fix this, including checking all of our production SQL server's settings. i tried every connection client, including linking the table in an access database and trying to connect to the table that way, and nothing. Every other application from access to excel to SSMS to visual studio itself could connect, just not my built application. Then i tried moving my project to my physical drive on a whim and all of the sudden, it had no connection issues.

SSIS Error - The AcquireConnection method call to the connection manager failed with error code 0xC0202009

I have scoured high and low for a solution but nothing has helped. To be clear, I am not developing a SSIS package, I am simply trying to run one that has already proven to work. This issue is server specific.
We have an ETL Job that builds a repository from a production database for reporting purposes. I built a new VM server with bigger resources to ease the burden of this process on our larger databases.
Server is Windows Server 2012R2. Running SQL Server 2014 SP2 CU05 with integration services and really not much else. This job runs through the agent on 15 minute intervals. The first few times it runs, it does actually start building some of the data in the destination database, but this error persists with every new batch that is executed, whether manually or on schedule, and after a while it just stops moving data.
Here is the base error:
SSIS Error Code DTS_E_CANNOTACQVIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "ETL_Framework" failed with error code 0xCO202009.
There may be error messages posted before this with more information on why the AcquireConnection method call failed.
Said error messages before the AcquireConnection call:
SSIS Error Code DTS_E OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005.
Source: "Microsoft SQL Server Native Client 11.0" Description: "Login timeout expired".
Source. "Microsoft SQL Server Native Client 11.0" Description: "A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online."
Source. "Microsoft SQL Server Native Client 11.0" Description: "Named Pipes Provider: Could not open a connection to SQL Server [2]. ".
One important thing to bear in mind is that both the source and destination databases are on this same server that the job is running from, meaning everything is localized and the domain service account is a local admin on the server and a sysadmin on SQL.
I have Named Pipes and TCP/IP protocols enabled on SQL. The service account running the job is a domain user that I have used hundreds of times on other servers setup for this same kind of work with never having a problem. I can connect via SSMS to this server from other VMs using the FQDN of the instance (i.e. SZDB.somewhere.com\SQL2014), and vice-versa.
So, open to suggestions here. There has to be something I am missing in the setup of my server.
We found that the solution in this case was to install a default instance of SQL Server. I previously only had a named instance running. As soon as I went through SQL setup and installed the default instance (i.e. MSSQLSERVER), the error on our ETL job went away and our data warehouse continued to build without any further issues. Proved to be the solution on two other servers as well that were exhibiting the same issue.

SQL server & Visual Studio

I need help with SQL server in visual studio. I can't seem to connect my visual studio with internal SQL server. I had created a database with visual studio earlier and it was working fine but now i'm getting an error saying:
The attempt to attach to the database failed with the following
information: 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.
I have tried to create a new database file in a new project but then i get the error:
A network related or instance specific error occurred while
establishing a connection. The server was not found or was not
accessible. (Provider:Named Pipes Provider, error:40- could not open a
connection to SQL server.
I have tried different things but can't seem to get the hang of the problem. I reinstalled visual studio too but that didn't work either. what can i do to get rid of this error and get my database back online?
If you are running Visual Studio on your local machine, you have not any problem with firewalls and enabling of TCP/IP.
Try this four solutions may fix your problem:
SQL Server Express LocalDB add-on, get it from this link.
Make sure that your SQL service is running.
Use SQL Server Authentication.
Make sure you have typed .\sqlexpress in Server name in Add Connection window. You should use a backslash \ as the separator, not a forward slash.

Cannot connect to SQL Server 2012 database remotely

Was able to connect to my SQL Server 2012 database using localhost with no problem storing it in the App_Data folder. My connection string was...
Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\bookingsandpreorders.mdf;Integrated Security=True
However when I hosted my site on another/remote server I got the following error:
Server Error in '/' Application.
The system cannot find the file specified
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ComponentModel.Win32Exception: The system cannot find the file specified
I thought it may be the connection string after looking at connection strings.com so I tried...
Server=.\SQLExpress;AttachDbFilename=|DataDirectory|\bookingsandpreorders.mdf;Database=bookingsandpreorders.mdf;
However now I just get another error...
Server Error in '/' 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 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)
I've watched and read a seemingly endless amount about this error mainly involving configuring firewall, tcp port... all of which have made no difference.
I think I've made a rookie error as I've not got much experience with SQL Server Express. any suggestions?

The server was not found or was not accessible - Server was lost for 6 hours

First off, I only have a very basic understanding of SQL. I can create tables etc. but configuration is beyond me. I am running my web site with MVC3 ASP.Net on a windows 2008 server using SQL Express.
Everything works fine, my connection strings are correct, I can use the website and it reads and writes to the dB, I can also view the dB with management studio on the server.
Today I got 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: 26 - Error Locating Server/Instance
Specified)
When I tried to log on to the database in management studio on the server I get a similar error. the only fix I have found is for a server restart. The database was down for 6 hours before I noticed which is not good for a start up website.
Has any one seen this issue before? Is this an express issue? Any help or advice would be great.
Troubleshoot as you would any network error. Start with the server's event logs.
As for notification of downtime, there are a lot of web services that will monitor your web site and email or send you an SMS message if it's not responding. Two that I've used are uptimerobot.com and basicstate.com. There are dozens of others.
You could also rewrite your ASP.Net app to email or text you when certain kinds of errors happen.