public void root() { string user_sig, sig, categ, pkey; con.Open(); SqlCommand cmd = new SqlCommand("select user_signature,signature,category,private_key from signature", con); SqlDataReader dr = cmd.ExecuteReader(); if (dr.HasRows) { while (dr.Read()) { user_sig = dr["user_signature"].ToString(); sig = dr["signature"].ToString(); categ = dr["category"].ToString(); string result = ""; string sig1 = categ; string num = sig1.Remove(1); Label1.Text = num; //Label2.Text = categ; switch(categ) { case "11": if (con.State == ConnectionState.Closed) { con.Open(); } dr.Close(); SqlCommand cmd1 = new SqlCommand("select distinct category from signature", con); SqlDataReader dr1 = cmd1.ExecuteReader(); if (dr1.HasRows) { while (dr1.Read()) { dr.Close(); string categ_sig = dr1["category"].ToString(); Label lblcateg = new Label(); lblcateg.Text = categ_sig; this.Controls.Add(lblcateg); } dr1.Close(); } dr1.Close(); con.Close(); break; case "12": Label lblcateg1 = new Label(); lblcateg1.Text = categ; this.Controls.Add(lblcateg1); break; //dr1.Close(); } } //dr.Close(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)