I'm currently working on a function that should simply insert data into a database. Normaly the code worked but now it doesn't. I click on the button that should insert the data and when I look if it inserted the data into my table there is no data. I don't have any error codes when I proceed the code.
SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\papri\source\repos\AOL-Rebirth-Project-RECENT\AOL-Rebirth-Project-RECENT\bin\Debug\accounts.mdf;Integrated Security=True;Connect Timeout=30");
con.Open();
SqlCommand cmd = con.CreateCommand();
cmd.CommandText = "insert into [Table2] (screenname) values ('" + textBox8.Text + "')";
cmd.ExecuteNonQuery();
con.Close();
I don't know what to do :(