ASP.NET + Umbraco + SQL Server - No connection could be made because the target machine actively refused it - asp.net

I'm trying to setup a local version of a website that's online and working. The site is built with Umbraco V6, and is using an SQL Server database. My test server is a fresh install of Server Standard 2012 and SQL Server 2012.
My process has been to:
Install the O/S and SQL Server
Setup a test Umbraco site in IIS, installing from scratch into a fresh database
Once 2. is working, download the source code from the live server and install in a new site in IIS
Download a copy of the live SQL Server database and restore it into the server
Add a new user account into SQL Server, granting permissions onto the SQL database i've restored
When I try to access the website through a browser, I get an error. This shows up in IIS as:
Event Code 3005. An unhandled exception has occurred. No connection could be made because the target machine actively refused it
I've disabled the Windows Firewall and have checked I can telnet into the server on port 1433. I know the Web.config is using the right credentials, as I can change it to a different user account and see a different error.
Can anyone point me in the right direction to resolve the error?

You should go through the steps listed over here:
http://blogs.msdn.com/b/sql_protocols/archive/2007/07/19/tcp-provider-no-connection-could-be-made-because-the-target-machine-actively-refused-it.aspx
I suspect that your connection string is pointing to the wrong server instance or that the TCP protocol is not configured correctly.
Tip: You can always copy and paste the settings from your connectionstring into the Connect Object Explorer of SQL Management Studio to verify that they work.

Related

ASP.NET can't access SQL server in VS2012

I had to reinstall SQL server, and now my app is not able to connect to the new (localhost) installation. My connection string is using windows authentication
I'm getting an error message that the login failed for MACHINE\USERX, however that user has full permissions for the SQL Server. I'm running Windows 10, and if I recall correctly you used to have to add ASPNETUSER, but that user does not exist, nor can I figure out how to have the IDE run as NetworkService etc.
ETA: SQL Server 2014 Express

Establishing connection to SQL Server Error

I opened my web project today and for some reason I could not gain access to my database files. I get the following exception whenever I try to add, edit or refresh my database:
A network related instance specific error occurred while establishing
a connection to SQL Server. The Server was not found or is was not
accessible. Verify that the instance name is correct and that SQL
Server is configured to allow remote connections.
I took a look at my connection string for any spelling errors and deleted my database and replaced it in the folder I had it in. I can't seem to find a fix for this so any help would be a appreciated. I am using Visual studio 2008 for this web project.
This sounds like the same problem that I had myself awhile back. My problem was that my SQL service pack 1 did not install properly so I had to install Microsoft SQL Server System CLR Types, Microsoft SQL Server 2008 Management Objects and Microsoft SQL Server 2008 Native Client. After that I could create new SQLdatasources but I could not edit the ones I had previously before my problem. I had to restart my computer in safe mode and delete my SQLEXPRESS folder then recreate the database connection in visual studios. When I finished that everything worked fine.
This is the site I got those downloads, http://blogs.cametoofar.com/post/cannot-load-file-or-assembly-microsoftsqlservermanagementsdksfc.aspx

Hosting SQL Server 2005 to website

I may seem silly asking this question. But since I am still a learner, I'm posting this question.
I have launched my asp.net website but I a unable to understand as to how to host the database i.e., SQL Server 2005. I have added the mdf file to the remote website, changed the connection string in the web.config to localhost as the data source.
You have to install Sql Server on the remote server that is running your website. Is that done already?
You can download Sql Server 2008 Express to get started with and install it on the remote server.
Where are you hosting your website? Is in your own server?
If it's a 3rd party hosting site, they may already have sql server running. You can check with them.
(You should probably provide more details about where and how you're hosting your app to get better feed back.)

Sql Server Error 26 Local

(The database is on my PC)
My database worked just fine for a month, and then this error came. It is not related to a specific file, nor a specific project (Even if I'll create a new website and try to add a new database file, this error will pop)
I guess it happens because the sql server is not running on my PC, and it is true that I don't see any sql related process running.
How the I fix it?
P.S. I know this error has a lot of threads on the internet and even here in SO. But most of them solve the problem for a complicated, secured connection with a remote server. All I want is to create a new empty ASP.NET website and add a new .mdf file for it on my PC.
It may be related with the SQL Service authentication which you have to verify from the control panel->Administrative tools->Services. Locate SQL Server(Express) Try changing the Log on As Network Service instead of local system.
that is a error Locating Server or Instance.
Try connecting by IP.
Have you disabled SQL Server browser?
I was facing something similar so I will share how I solved it, it might work for you or not, but here are my 2 cents.
My environment: Windows 10 ( upgraded from windows 8 in which SQL Server was working fine)
SQL Server 2014 Express
Solution: I Opened the services program, and found the SQL Server services, I saw that all of of them were up except by one which was disabled, the "SQL Server Agent", I enabled it and was able to connect to my DB instance.
Hope it helps
Regards

ASP.NET: Can't connect to SQL Server database after uploading to server

I'm trying to upload my asp.net site to my HostGator windows server. I'm having a problem connecting to the SQL Server database in my App_Data folder. It's giving me the error:
Login failed for user 'PSS004\IWPD_353([UserName])'.
I use Windows Authentication in Visual Studio 2010 to access the database and view the site just fine locally. Is that causing a problem? If so how do I set up a user/pass to use when accessing the database file once it's on my hosting server?
If any further information is needed that I left out just let me know.
Thanks!
When you run the code from your webserver, its most likely using a network service account (and hence windows auth wont work). Add a user account to sql server and change the connection string to use sql auth instead and that should fix it

Resources