.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Cannot connect to SQL2005 database

Posted By:      Posted Date: October 27, 2010    Points: 0   Category :Sql Server


When I try to connect to an SQL2005 database I always get this error:

"A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.) (Microsoft SQL Server, Error: 10054)"

I found several articles about this - but the problem is still around.



View Complete Post

More Related Resource Links

could somebody give me example how I can connect to database only once if I use many models in contr


I use in my ASP.NET MVC application repository pattern and I use in controller for example 3 models:

   namespace MvcApplication1.Controllers  
        public class HomepageController : Controller  
            private IWebsitesRepository _repository_websites = new WebsitesRepository();  
            private IFirmRepository _repository_firm = new FirmRepository();  
            private IPhotosRepository _repository_photos = new PhotosRepository();  

In WebsiteRepozitory, FirmRepository and PhotosRepository classes I have:

Database1Entities _entities = new Database1Entities();

So I have 3 connections to database ? Is it wrong ? How can I solve it ?

unable to connect to database



I am using visual studio 2005 and sql server 2005.

I am developing a small quiz application and i have stored the connection string in app.config file which is given below.:

<?xml version="1.0" encoding="utf-8" ?>
        <add name="quizdb"
            connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|Quiz Application.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True"
            providerName="System.Data.SqlClient" />
i have retrieved connection string property through configurationmanager class 

and when i m connecting to database  it gives me a runtime error:


Sql Exception was unhandled

System.Data.SqlClient.SqlException was unhandled
  Message="An attempt to attach an auto-named database for file F:\\Quiz\\Quiz\\bin\\Debug\\Quiz Application.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located

Connect to existing sql 2005 database


Hello There,

I had successfully restored sql 2000 database to sql 2005. It works like charm

Now i am creating a database model in MVC

I follow these steps

Right click on model > ADO.NET entity data model > Generate from database > New connection (Microsoft sql server) > server name > select or enter database name

But no server name AND database name show in both drop down lists. When i mannually enter database name (which exists in sql 2005) then click on TEST CONNECTION. It gives follwoing error

"A network-related or instance-specific error 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.

Kindly help me with this


Cannot connect to the configuration database.



when i open my central administation i get this error:

Cannot connect to the configuration database


plz help?

cannot connect to the configuration database


Hi All,

Recently I have migrated my SharePoint BackEnd (Database) Server to new hard drive. The reason of migration was to deploy and configure real time database replication by Symantec Veritas. After migration activity I was getting following error message

" cannot connect to the configuration database ".

But when I execute following steps, this errors message gone and everything got fine

1. Enable Named Pipe from SQL Server Configuration Manager > Protocols for MSSQLSERVER

2. Restart  SQL Server (MSSQLSERVER) service (Note: This service was already running and status was set to automatic ) and

3. Start SharePoint Configuration Wizard  

Now I need to know why every time I have to restart this service? When I turned on my sharepoint server machines in the moring I have to restart this service ( SQL Server (MSSQLSERVER) otherwise same error message appears (cannot connect to the configuration database). After restarting this service everything gets normal.

Any help in this regard will be greatly appreciated.


Cannot connect Visio 2007 to SQL Server CE 3.5 database?

I am trying to reverse engineer a database (running under SQL Server CE 3.5 SP1) with Visio 2007 Professional.  I may be being blind, but I can find not way for Visio to do this.  Am I missing something or just piddling into the wind? Fully patched Vista. Thanks, Ed Bessant  

connect client certificate to an account in a membership database

Hello I have created a web service that authenticates with username and password, works fine.Basically this one, http://msdn.microsoft.com/en-us/library/ff649647.aspxNow I also want to connect to this web service using client certificates, works finehttp://msdn.microsoft.com/en-us/library/cc948997.aspx But I would like to when authenticated via client certificates, connect that certificate to a user in the membership database.So that I can use Roles.IsUserInRole(...) and such.I thought that, well if I implement a Custom certificate Validatorhttp://msdn.microsoft.com/en-us/library/ms733806.aspxthen I could check for example subject and map that against a created username in the membership database.But in the class X509CertificateValidatorpublic override void Validate(X509Certificate2 certificate)I don't have the same ability as when the user is authenticatedlike  void OnAuthenticateRequest(object source, EventArgs eventArgs)HttpApplication app = (HttpApplication)source;Basically how can I do this app.Context.User = new GenericPrincipal(new GenericIdentity(username, "Membership Provider"),roles);withinpublic override void Validate(X509Certificate2 certificate)and if that is not possible, can this be solved differently?Bottom line, how do I connect a client certificate to a user account in the membership database. Is there a MSDN article

Reporting Services Add-In for MOSS2007 : Unable to connect to the database Error at "Set Server Defa

Dear Expert, I've succesfully install the Add-In + configure the reporting services (integrated mode) + activate the features on my MOSS2007. As we know by activating this at my Central Admin, i'm able to see "Reporting Services" under my Application Management as below:   1) Manage Integration Setting   ---> My report url : http://servername:808/ReportServer (Trusted Account) 2) Grand Database Access --->  My setting : <servername> with default instance  3) Set Server Defaults ---> Area that i receive an error "Unable to connect to database" Anybody here have a same experience? please assist me, Thanks in Advanced My Note: OS : Windows Server 2008 Enterprise x64bit (SP2) SQL : SQL 2005 with latest Service Pack (SP3)  My Error Log: <Header>   <Product>Microsoft SQL Server Reporting Services Version 9.00.4035.00</Product>   <Locale>en-US</Locale>   <TimeZone>Malay Peninsula Standard Time</TimeZone>   <Path>c:\Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\LogFiles\ReportServer__08_04_2010_10_51_59.log</Path>   <SystemName>SEINE</SystemName>   <OSName>Microsoft Windows NT 6.0.6002 Service Pack 2</OSName>   <OSVersion>6.0.6002.131072</OS

Why can I not connect to SQL Server Database?

Can somebody PLEASE try and assist me with this issue - it's been driving me insane for 2 weeks and I am seriously at the end of my tether now... I'm attempting to use ASP.NET Configuration from the Website Menu of Visual Web Developer 2010 Express. (Note: I have downloaded SQL Server 2008 & SQL Server 2008 R2 with VWD 2010 Express via Web Platform Installer.) I'm selecting 'select a single provider for all site management data' followed by; 'AspNetSQLProvider' but every time I try and click 'test' I get the following error message:   Could not establish a connection to the database.  If you have not yet created the SQL Server database, exit the Web Site Administration tool, use the aspnet_regsql command-line utility to create and configure the database, and then return to this tool to set the provider. After the scouring the 'net for literally tens of hours, I've found several forums that I thought would help, such as; * Re-installing SQL Server and copying the .exe file to the desktop to get the SQL Server to be able to be installed properly (which I've done and it seemed to install successfully), BUT even after doing this I keep getting the error as underlined above & * Finding the aspnet_regsql file and installing it via it's wizard I've tried doing the above on both my 32-bit Windows XP laptop AND my 64-bit Windows 7 laptop - b

unable to connect to a database engine

Hi. i have recently installed SQll Server 2005 but i am facing issue while connecting to a databse engine..how should i do it..?its showing an error which looks like this TITLE: Connect to Database Engine ------------------------------ Cannot connect to sanchit. ------------------------------ ADDITIONAL 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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 53) For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=53&LinkId=20476 please assist me in this....

Intermittent SharePoint database connect error on SQL cluster

SQL 2008 Cluster has two SQL instances. Two separate SharePoint farms are "connected" with each SQL instance. SharePoint frontend servers eventlog is flooded with "unable to connect with database.." kind of errors for few minutes during diferent time interval. This erros occurs at the same time on both SharePoint farms. (Note that both SharePoint farm doesn't share any info, that is, each farm is running independantly). Someone suggests SQL box has some bandwidth/network issue. Enabled SQL trace. But not sure how to analyze. Can someone help? Thanks in advance    

Cannot connect to the configuration database

After Installing Sharepoint 2010 i get "Cannot Connect to the Config Database" error. Im guessing this is a account access issue but i cant find anything detailing about it or what access is required? Anyone seen this? Cheers, Todd

Reporting Services doesn't connect to database automatically

Hello. I use Windows 2003 R2 x64 and SQL Server 2005 x64.  The problem is: if the Reporting Services Service were doesn't start automatically, despite the set up parameter "Restart Automatically" every 1 minute in the service Recovery property. So every minute after Service stopped i recieve an error in Event Viewer: Report Server (MSSQLSERVER) cannot connect to the report server database However, after starting it manually from Computer Management->Services or Reporting Services Configuration Tool it starts normally without any error. I use local system admin account to start Services and to connect to Database. Both parameters are set using RS Configuration Tool. Will be thankful for any advice.

Can't connect my VWD express "sqldatasource" control to a SQL Server Express Database

Good day Sirs,   As the title is saying, I cant seem to connect to my SQL Server Express Database using "sqldatasource" control in Visual Web Developer 2010 Express Steps Taken: clicked "configure data Source" option in the Sqldatasource then "New Connection..." Changed my Data source: to " Microsoft SQL Server Database File (SqlClient) Here comes the problem: 1. I am choosing a Database file name but a problem keeps on popping:     "ServerName This file is in use: Enter a new name or close the file that's open in another program" 2. Then I tried to choose a detached database file (mdf) and it was attached now another problem pops:    "ServerPath cannot be opened becuase it is version 661. This server supports 655 and earlier.   I am using windows Home Edition: does it contribute to my problem? My server and VWDE is in the same equipment(laptop)   Does anyone have an idea why is it like this? Thanks

How to connect from Crystal Report to FireBird Database

Hi, Im using a crystal report in Visual Studio 2005 and I need to connect to a Firebird Database but a dont have idea how to connect it, Please help me...

Cannot connect to the configuration database after updating SQL SP3

hi, We're using WSS 3.0 with SQLExpress 2005. Because Symantec Backup Exec 2010 also install on this server, so I have to update to SQL Service Pack 3. But after updated to sql service pack 3 and installed Backup Exec 2010, I cannot connect to sharepoint. When I access to Central Administration, an error appears: "Cannot connect to the configuration database" I followed this instruction: http://support.microsoft.com/kb/823287 but the problem still persists. Does anyone know how to solve this problem? Thanks
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend