Establishing connection to SQL Server Error - asp.net

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

Related

How to restore SQL Server to default settings

I'm new to Visual Studio and SQL Server. Basically, I have purchased Microsoft Visual Studio 2010 premium but am having some problems. I have a very basic application with a registration form (CreateUserWizard) and every time I try to run it I get error 26 server instance not found.
"provider: SQL Network Interfaces, error: 26 - Error Locating
Server/Instance Specified"
When I open SQL server configuration all of the server instances are stopped SQL Server (SQLEXPRESS), server agent and server browser. When I try to start them it says "the response failed or did not respond in a timely fashion" When I try to edit the filesystem or any of the server settings I get a message "The specified resource name cannot be found in the image file". I tried to refresh my laptop and delete all applications and server instances, but the error still persists. I just wanted to know is there anyway I could reset the SQL server to default setting (I think I may have mistakenly deleted MSSQLSERVER) and reinstall visual studio. It did work on my laptop before. Thanks in advance for all your help. Using visual studio 2010 with VB.net
Got it sorted. Installed SQLSERVER and enabled the server browser during setup.

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

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.

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

OleDB Provider for Oracle not found in in Windows Server 2008 with IIS 7

I'm deploying a small ASP.NET (framework 3.5) application in a Windows Server Web 2008 32 bits, IIS 7. The applications needs connection to an Oracle DB in another Server, using the tradicional DataAdapter, Oracle Connection, etc.
I´ve installed correctly the Oracle Client in the server (the server is another server´s client) and I´ve checked that this server has access to the server where the database is.
Even though my app isn´t able to connect to DataBase. The message says that Oracle components haven´t been found. It doesn´t find the OleDB Provider for Oracle or some dll.
¿Something I shluod know about permissions of the ASP.NEt users or something like this?
Some idea??
Thanks in advance.
Gus.
Check the path. It could be that the Oracle client directory is not on the path of the account that runs your ASPNET app.
Actually there are other steps you can go through, to verify the Oracle client install.
This article is old but may be helpful.

ASP.NET application - Error when trying to connect to a SQL Server 2008 instance

Despite that I’m a regular reader of this great forum, this is my first post on it. I believe that this community can help me with the following problem that I have.
I’m trying to publish an ASP.NET website over an IIS 6.0 (Windows 2003 Server), and I have some troubles trying to connect to the database. Curiously, I have installed another ASP.NET website into the same IIS 6.0 with the same properties and security parameters and can connect without problems with the same database. The application that works fine is almost the same that the one that can’t connect with SQL Server (actually is the same but with several modifications).
I’ll enumarate some information related to the problem:
S.O: Windows 2003 Server
SQL Server Engine: SQL Server 2008 SQL Server accept remote connections? Yes.
ASP.NET version: 2.0.50727
The connections via TCP/IP are enabled to the SQL Server instance? Yes.
The corresponding user that I have in the connection string, actually exists into the database with the “owner” role? Yes.
ORM Tool used: nHibernate
I get the following error when I try to run the aplication into the browser:
Error while establishing a connection
to the server. When connecting to SQL
Server 2005, this failure may occur
because the default settings SQL
Server does not allow remote
connections. (provider: Shared Memory
Provider, error: 40 - Could not open a
connection to SQL Server)
In order to isolate the problem, I made some test. For example, using the web app that works fine I can connect without any problema with the database that uses the web app that can’t. With this evidence I concluded that the problem is within the web app and not into the SQL Server instance. I also google it my problem but sadly I can't find nothing usefull to solve it.
If someone can help me I’ll appreciate that.
Thank you so much for your time!
The most likely explanation is that your connection strings are not the same between the two applications. The error in question is talking about the Shared Memory provider, which is not the same as TCP/IP connections.
I've found the problem. In order to solve it, I was install in a virtual machine the same OS (Windows 2003 Server) and IIS (6.0). In this clean enviroment, I've found that the changes that I made in the home page was the problem. This aspx page has Web Parts that I'll investigate to know why is causing troubles with the database connection. I navigate to another page of the web application and it can connect with the database and retrieve information without any problem..but when I try to reach the home page the aplication colapse because of the problem that I tell you in this thread.
I'll post more news about this problem when I resolve it completely
Thanks for your assistance and time.

Resources