i try to create a connection from my app to database. Build is started but is failed. I don't understand why. When i press login nothing happens. Here is my code:
private void button1_Click(object sender, EventArgs e)
{
SqlConnection log = new SqlConnection("Data Source=MODIFIEDforStackOverflow;Initial Catalog=logininfo;Integrated Security=True;Connect Timeout=15;Encrypt=False;TrustServerCertificate=True;ApplicationIntent=ReadWrite;MultiSubnetFailover=False");
log.Open();
string newcon=("select username from login where username='"+textBox1.Text+"' and password='"+textBox2.Text+"'");
SqlDataAdapter adp = new SqlDataAdapter(newcon, log);
DataSet ds = new DataSet();
adp.Fill(ds);
DataTable dt = ds.Tables[0];
if (dt.Rows.Count >= 1)
{
settext = textBox1.Text;
welcome wc = new welcome();
wc.Show();
this.Hide();
}else
{
label3.Text = "Invalid Login!";
}
}
Here is my errors:
Severity Code Description Project File Line Suppression State
Error Could not copy "obj\Debug\YourTips_App.exe" to "bin\Debug\YourTips_App.exe". Exceeded retry count of 10. Failed. YourTips_App
Error Unable to copy file "obj\Debug\YourTips_App.exe" to "bin\Debug\YourTips_App.exe". The process cannot access the file 'bin\Debug\YourTips_App.exe' because it is being used by another process. YourTips_App
Thank you!