hello!
am getting this error in select operation (button click event)
Cannot open database "SignUp" requested by the login. The login failed.
Login failed for user 'ABC\abhishekj'.
Line 29: string strcon = ConfigurationManager.ConnectionStrings["connection"].ConnectionString;
Line 30: SqlConnection con = new SqlConnection(strcon);
Line 31: con.Open();
Line 32: SqlCommand cmd = new SqlCommand("SELECT * FROM SignUp", con);
Line 33: DataSet ds = new DataSet("SignUpDataSet");
Please tell me, How to resolve it.

Abhishek JaiswalPosted Jul 9, 2014, 9:08 AM
i'll write back its solution in a blog.
:)
Ranjit PowarPosted Jul 9, 2014, 3:36 AM
Khan Abrar AhmedPosted Jul 9, 2014, 3:23 AM
ABC\abhishekj" this user has access on the database or not.
if not then give the access to the user on database and try to connect.for this:
1. open the sql server mangement and try to connect using the above user name and password.
2. if you successfully login then explore the database and try to run any simple script.
3. if it fails then add the login user on the database.
Abhishek JaiswalPosted Jul 9, 2014, 2:50 AM
still its not working, got a new error now saying,
Cannot open database "SignUp" requested by the login. The login failed.
Sanjay KumarPosted Jul 9, 2014, 1:13 AM
http://www.connectionstrings.com/store-connection-string-in-webconfig/
https://www.connectionstrings.com/sql-server-2012/
http://www.c-sharpcorner.com/UploadFile/47548d/async-sqlconnection-in-Asp-Net-4-5/
Abhay ShankerPosted Jul 9, 2014, 1:12 AM
Also Check the permission of the user in database, you have added in connection string
Abhijit PatilPosted Jul 9, 2014, 12:38 AM
you are write connection string in web configuration file,kindly check the spelling and all the information is correct .
hope it helps
thanks and Regards,
Abhijit Patil
http://dotnetbyabhipatil.blogspot.in