Click here to Skip to main content
15,910,878 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
<add name="ConnectionString" connectionString="Data Source=(Local);Initial Catalog=db;User ID=myusername; Password=my password" providerName="System.Data.SqlClient"/>
</connectionStrings>




and i am using this code in my code behind of aspx file


C#
SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);


but this error...
C#
Login failed for user "myusername"
Posted
Comments
ZurdoDev 17-Jan-14 12:06pm    
What's the question? Your login failed.
m-e-h-d-h-i 17-Jan-14 12:18pm    
yes

1 solution

That means your credentials are not valid. Double-check the username and password, as that is your problem.
 
Share this answer
 
Comments
m-e-h-d-h-i 17-Jan-14 12:19pm    
How can i solve this
m-e-h-d-h-i 17-Jan-14 12:23pm    
I checked my username and password several time but no problem
Richard C Bishop 17-Jan-14 17:12pm    
You need to get the correct credentials for the server, that is all.

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



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