Beispiel #1
0
        protected void find2()
        {
            cmd2 = new SqlCommand("select * from Partners_Notes_table_edutrack where nt_subject like @name+'%'", con);
            cmd.Parameters.Add("@name", SqlDbType.NVarChar, 50).Value = TextBox_Search.Text;
            ad = new SqlDataAdapter();
            ad.SelectCommand = cmd;
            DataSet ds2 = new DataSet();

            ad.Fill(ds2);
            Employee_grid.DataSource = ds2;
            Employee_grid.DataBind();
        }
Beispiel #2
0
        protected void Button_Search_Click(object sender, EventArgs e)
        {
            con = new SqlConnection();
            con.ConnectionString = ConfigurationManager.ConnectionStrings["cn"].ConnectionString;
            con.Open();
            cmd = new SqlCommand("select * from Registration_table_edutrack where u_name like @name+'%'", con);
            cmd.Parameters.Add("@name", SqlDbType.NVarChar, 50).Value = TextBox_Search.Text;
            ad = new SqlDataAdapter();
            ad.SelectCommand = cmd;
            DataSet ds = new DataSet();

            ad.Fill(ds);
            Employee_grid.DataSource = ds;
            Employee_grid.DataBind();
        }