Help : "error: 40 - Could not open a connection to SQL Server"

Hi,

I have a Server Win2003 with only Frameword 2 and SqlServer 2000

In my webApplication C# / Asp.net , I add a WebParts

I don't understand, I have all connect to dataBase SqlServer2000 in my web config, but in folder APP_DATA, visual studio created ASPNETDB.MDF

On my server, I have a mistake :

An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

My web.conf

<connectionStrings>
   <
add name="connectionString" connectionString="server=****;user ID=****;password=****;database=****" providerName="System.Data.SqlClient"/>
</connectionStrings>

<membership defaultProvider="local">
<
providers>
<
add connectionStringName="connectionString" applicationName="/myApplication" description="" passwordAttemptWindow="10" minRequiredPasswordLength="3" minRequiredNonalphanumericCharacters="0" passwordStrengthRegularExpression="" requiresUniqueEmail="true" enablePasswordRetrieval="true" passwordFormat="Clear" enablePasswordReset="false" requiresQuestionAndAnswer="false" name="local" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b03f5f7fDJKDa3a"/>
</
providers>
</
membership>
<
profile defaultProvider="local">
<
providers>
<
add connectionStringName="connectionString" applicationName="/myApplication" description="" name="local" type="System.Web.Profile.SqlProfileProvider, System.Web, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b03f5f7fDJKDa3a"/>
</
providers>
</
profile>
<
roleManager enabled="true" defaultProvider="local" domain="">
<
providers>
<
add connectionStringName="connectionString" applicationName="/myApplication" description="" name="local" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b03f5f7fDJKDa3a"/>
</
providers>
</
roleManager>

If you have an idea, thanks for your help.


my blog : michel degremont
0
wesleymichel
12/3/2005 10:41:14 AM
asp.net.personalization 3779 articles. 0 followers. Follow

3 Replies
486 Views

Similar Articles

[PageSpeed] 1


Hi,

you need to change the default setting for storing personalization data to sql2k by add the following lines,

<connectionstrings>

<clear />

<add name="LocalSqlServer" connectionString="server=xxxx;user id=xxxx;password=xxxxx;database=[Your database name]"

providerName="System.Data.SqlClient" />

Hope that helps,

Lan

0
lano
12/5/2005 5:55:23 PM
Hi, 

Did you solve the problem? I had exact same problem and have no idea to solve it. Can you give me some idea?

Thanks in advance,

Gary
0
netdream
1/2/2006 7:51:45 PM
No, I have installe sqlServer 2005
my blog : michel degremont
0
wesleymichel
1/2/2006 8:46:03 PM
Reply:

Similar Artilces:

upgrade error:"CONNECTIVITY ERROR:DB-Library: "SQL Server connection timed out."
PLEASE HELP OH WISE SYBASE GURUS! upgrading 11.9.2 to 12.0. unloaded software. rebooted server. selected "upgrade server" in Configure Sybase Servers window. typed in sa password. got "CONNECTIVITY ERROR: DB-Library: "SQL Server connection timed out." -- Chuck Boyce chuck_boyce@operamail.com http://www.geocities.com/chuck_boyce_jr/ Yahoo Messenger ID: chuck_boyce_jr http://messenger.yahoo.com AOL Instant Messenger ID: sg95m476 http://www.aol.com/aim/ ICQ Messenger ID: 41449031 http://www.icq.com ...

"Could not open a connection to SQL Server" error
 I just installed SQL Server 2005 on my local PC, along with VS 2008, IIS, ... When I test the web application, I keep getting the above error message despite following every suggestion I could find through Google. I have: - Created a user on SQL Server  with password, asigned it to be dbo on the test database - Enabled Remote Connections through SS Surface Area Configuration, enabled "using both TCP/IP and named pipes"; also started SQL Server  Browser service _ made sure sqlserver and sql browser are added to firewall exception list - Added "Network ...

HELP! error connecting to SQL Server! "...The specified module could not be found."
Hi AllI have been having an issue connecing to SQL server using VS2003.  This just started happening a few days ago.  I have re-installed the framework, VS, but am still getting the following error:An unhandled exception of type 'System.IO.FileNotFoundException' occurred in system.data.dllAdditional information: The specified module could not be found.I wrote a little WinApp to trap the exception and provide the stacktrace below;Exception.Message = The specified module could not be found.Exception.Stacktrace =   at System.EnterpriseServices.Platform.Initialize() &nbs...

Connecting to sql server 2000 on Godaddy error: (provider: Named Pipes Provider, error: 40
Facts:1. I am using my account on Godaddy trying to connect to my sql server db.2. I can get into my db using user id and password.3. Godaddy's help file shows this for a connection string: connectstr = "Driver={SQL Server};SERVER=" & db_server & ";DATABASE=" &db_name & ";UID=" & db_username & ";PWD=" & db_userpassword4. My connection string: "Server=whsql-v09.prod.mesa1.secureserver.net;uid=dbasolutions;pwd=***;database=DB_87972;"  & _                    "Trusted_Connecti...

"Alias is not currently opened. Database server rejected connection. Database server connection limited exceeded." error message
Hello Sybase User Experts, I like to find out the cause of this error message "Alias is not currently opened. Database server rejected connection. Database server connection limited exceeded." Do you have any idea about this? What is the cause and how to solve this problem?! Your answer or idea to this error message will be a great help to me. Thank you in advance. Regards, Beverly Beverly, First of all, what database server are you using? And how are you connecting to it? -- Regards, Millard[TeamSybase] <Beverly> wrote in message news:3f7932b1.1356....

"Object was open" error when using ADO to connect to SQL Server CE 3.5
Hi all, I'm hoping someone can help me with this problem. I am trying to connect to a SQL Compact file using the following ADO commands. {code} Query := TADOQuery.Create(nil); Connection := TADOConnection.Create(nil); Connection.ConnectionString := 'Provider=Microsoft.SQLSERVER.CE.OLEDB.3.5; Data Source=c:\temp\test.sdf;'; Connection.LoginPrompt := False; Query.Connection := Connection; Query.SQL.Text := 'SELECT * FROM INFORMATION_SCHEMA.TABLES'; Query.Open; {code} When the {code} Query.Open {code} is executed I get the er...

Problem in Connecting Database. error " SQL Server does not allow remote connections."
Hi Forum, Heres the scenario. I have VS2008 and SqlServer Enterprise Edition installed in my machine. I connect to the database inside the same machine using VS2008. I opened the project my client gave me inside vs2008. When I ran the project, the it runs. but the aspx page to be displayed shows error like  'Problem in Connecting Database. error " SQL Server does not allow remote connections." ' I have db and vs in the same machine ( no remote machine involved). Why does this error came? How to Rectify it? Any guidelines are de...

Getting "When connecting to SQL Server 2005 Error" using MS SQL 2000?
I'm new to using VS2005 and this is my first project connecting to our MS SQL 2000. App worked fine on my dev PC, connection to the same MS SQL Server. Published the web site to the web server (same server running MS SQL Server) and getting the below error. Is this a permission setup problem on SQL Server or does it really think it's connecting with a MS SQL 2005 database? An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remot...

SQl Server Error: ----> Named Pipes Provider, error: 40
  Hi Friends, Im using .Net2008 and MS SQL Server2005, I Have a web application , i want to connect to the server machine SQL Server,  When i run the application im getting the following error. Im trying to connect to the database from local machine application to server machine database   An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Cou...

"ODBC" "OleDb": Hosting for SQL Server 2000. Help!
All my code is from the SqlClient namespace, so am I ok if I use asp.net 1.1 / 2.0 hosting and ODBC or OleDb as the "connector" technology?Thanks. I guess yes, but using the correct classes would be better..   RegardsASP.NET Hosting (HostingFest) I came across a host that offered SQL Server 2000 hosting and nowhere was "ODBC" or "OLEDB" mentioned. I was told that I am given a ready made SQL db to use. I just transfer my tables, etc to it.I know that I use the Oracle namespace if I am connecting to Oracle. But such understanding is not about how Oracle is connected to .NET. I presu...

SQL Server 2005 error: "Incorrect syntax near "-" "
Hello, I have an application written in visual basic which connects to a SQL Server 2005In DB of SQL Server I have many tables. Table names can contain chars like: "-",  "\",  ".", etc. When I execute the instruction in visual basic sTableName= "Table-3" ' or ""Table-3"" or "Table_1" or sTableName= """" + "Table_1" + """"   -> """" = 4 quates (2 for string identify and two for writing in string a quate chr(34)->" strQu...

"connections to SQL server files (*.mdf)" error message in Visual studio when adding a new SQL database
Hope you can help. Running Visual Studio 2005 and SQLServer2005.  I have created a new project and am attempting to add a new SQL database to it.  When I select the SQL database I get an "Connections to SQL server files (*.mdf) requires SQL Server Express to function properly" error message.  I also tried to add an existng database and it errors out as well "The file can not be opened as it is being used by another process.....".  However, I can create a new data source connection to existing SQL databases.  One caveat though.  I can ...

"A connection with the server could not be established" error opening localhost.
I am trying to open a new Asp.Net application using Visual Studio.Net 2003 on my stand alone home machine.  I am opening it in HTTP://localhost/webnewapp.  Each attempt to open results in an error message saying "A connection with the server could not be established".   I am using Windows XP SP 2, IE 6.0 ASP.net version 1.1.4322.  Have run aspnet_regiis.exe with the -i switch, the -enable switch, the -ir switch and the -r switch.  Have checked the application mappings in the configuration of IIS and they all point to the v1.1.4322 directory.  IIS is...

Web resources about - Help : "error: 40 - Could not open a connection to SQL Server" - asp.net.personalization

Resources last updated: 1/18/2016 6:15:37 PM