0
 private void Form1_Load(object sender, EventArgs e)
        {
            cn.Open();
        }

ERROR:Cannot open database "Persons" requested by the login. The login failed.
can anyone tell me how to fix this?

2
Contributors
2
Replies
11
Views
3 Years
Discussion Span
Last Post by castajiz_2
0

It means that your application is trying to login to sql and retrieve the data. but it's being prompted for a username and password. You need to specify this in your connection string for cn.

Edited by Fenrir()

0

yeah, i forgot to copy and paste the new string since i deleted my previous database..., tnx

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.