romasha ali

romasha ali

  • NA
  • 94
  • 38.5k

sql query

Oct 27 2013 5:02 PM
below is my code that showing db data on label but i wanted to a search bar which take specified column data and then show on that row data on labels
like: i give teacher name on search bar and then only that teacher data will show on labels
guide me please



 protected void Button1_Click1(object sender, EventArgs e)
        {
             string intero = "Select * from Faculty";
            SqlCommand cmd = new SqlCommand(intero, con);

            SqlDataReader rdr;

            rdr = cmd.ExecuteReader();

           
            while (rdr.Read())
            {


                Lbl1.Text += rdr[0] + "" + rdr[1] + "<br/>";
            }

            rdr.Close();
            con.Close();

        }

Answers (1)