示例#1
0
        private void button3_Click(object sender, EventArgs e)
        {
            Form13 f13 = new Form13(username);

            this.Hide();
            f13.Show();
        }
示例#2
0
        private void button7_Click(object sender, EventArgs e)
        {
            string pr = listBox1.GetItemText(listBox1.SelectedItem);

            string commString = "DELETE FROM [" + username + " prieteni] WHERE Username ="******"'" + pr + "'";
            string conString  = Globals.con;

            using (SqlConnection conn = new SqlConnection(conString))
            {
                using (SqlCommand comm = new SqlCommand())
                {
                    comm.Connection  = conn;
                    comm.CommandText = commString;
                    conn.Open();
                    comm.ExecuteNonQuery();
                }
            }
            commString = "DELETE FROM [" + pr + " prieteni] WHERE Username ="******"'" + username + "'";
            using (SqlConnection conn = new SqlConnection(conString))
            {
                using (SqlCommand comm = new SqlCommand())
                {
                    comm.Connection  = conn;
                    comm.CommandText = commString;
                    conn.Open();
                    comm.ExecuteNonQuery();
                }
            }
            Form13 f13 = new Form13(username);

            this.Hide();
            f13.Show();
        }