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?

Recommended Answers

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.

Jump to Post

All 2 Replies

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.

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.