private void btnPublish_Click(object sender, EventArgs e)
{
Sqlbaglan.NesneVer().thisConn = new SqlConnection(@"Data Source=(localdb)\mssqllocaldb;initial catalog = ManagerPanel;integrated security = true");
Sqlbaglan.NesneVer().thisConn.Open();
Sqlbaglan.NesneVer().thisQuery = new SqlCommand("SELECT Kurallar FROM [Rules] WHERE TC=@TC", Sqlbaglan.NesneVer().thisConn);
Sqlbaglan.NesneVer().thisQuery.Parameters.AddWithValue("@TC", tbxTC.Text);
label1.Text = Sqlbaglan.NesneVer().thisQuery.ExecuteScalar().ToString();
Sqlbaglan.NesneVer().thisConn.Close();
}
Friends, I have 2 problems, I do not have much knowledge of sql, but I wanted to do my job with the database. I created sql conn and query object with singleton dp. I called the rule that has that TC with the TC entered in tbxTC and printed it on label1.Text in the SAME FORM. So far, everything happens as I want. My 1st problem is that when I open and close the form, label1.Text gets reset. Consider my second problem independent of my first problem. My second problem is that I have written in capital letters already - I am nervous- I have to show it in another form. This form's name is frm2. So consider label1.text is in another form.