Click here to Skip to main content
15,884,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I am using asp.net 4.0 and trying to implement the login functionalities...
I created a database on sql server called LoginDB and added the user myUser with password to it.
The website administration tool shows as:
The connection name 'ApplicationServices' was not found in the applications configuration or the connection string is empty

Do you know what I have to do to solve this please?
Thanks
Posted

1 solution

Check whether you have written connection string in web. config.
something like this.
If your connection string name is myconnectionstring and in the aspx code behind, you have to use same name.


XML
<connectionstrings>
<add name="<b>myConnectionString</b>" connectionstring="server=localhost;database=myDb;uid=myUser;password=myPass;" />
</connectionstrings>


To read the connection string into your code, use the ConfigurationSettings class.

string connStr = ConfigurationManager.ConnectionStrings["myConnectionString"].ConnectionString;


Can you check in your code whether both matches?
 
Share this answer
 
v3
Comments
arkiboys 6-Aug-12 9:50am    
Hi, I have already added this line:
<connectionstrings>
<remove name="LocalSqlServer">
<add name="LoginDB" connectionstring="Data Source=servername;Initial Catalog=LoginDB;User Id=myuser;Password=xxx" providername="System.Data.SqlClient">
Santhosh Kumar Jayaraman 6-Aug-12 9:54am    
whats ur connectuion string name? is it ? application service? or somethin els?
Santhosh Kumar Jayaraman 6-Aug-12 9:57am    
also check the updated solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900