public void databinding(string key)
        {
            searching s = new searching();
            SqlDataAdapter adapter = s.search(key);
            SqlCommandBuilder builder = new SqlCommandBuilder(adapter);

            DataSet ds = new DataSet();
            adapter.Fill(ds, "Books");
            ds.Tables["Books"].PrimaryKey = new DataColumn[] { ds.Tables["Books"].Columns["BID"] };
            result_grid.DataSource = ds.Tables["Books"];
            result_grid.DataBind(); 
        }
        public void databinding(string key)
        {
            searching         s       = new searching();
            SqlDataAdapter    adapter = s.search(key);
            SqlCommandBuilder builder = new SqlCommandBuilder(adapter);

            DataSet ds = new DataSet();

            adapter.Fill(ds, "Books");
            ds.Tables["Books"].PrimaryKey = new DataColumn[] { ds.Tables["Books"].Columns["BID"] };
            result_grid.DataSource        = ds.Tables["Books"];
            result_grid.DataBind();
        }
Exemplo n.º 3
0
        protected void Search_btn_Click(object sender, EventArgs e)
        {
            string key = this.search_box.Text.ToString();
            searching s = new searching();
            SqlDataAdapter adapter = s.search(key);
            SqlCommandBuilder builder = new SqlCommandBuilder(adapter);

            
            
            DataSet ds = new DataSet();
            //adapter.Fill(ds, "Books");
            adapter.Fill(ds, "Books");
            ds.Tables["Books"].PrimaryKey = new DataColumn[] { ds.Tables["Books"].Columns["BID"] };
            result_grid.DataSource = ds.Tables["Books"];
            result_grid.DataBind();
        }
Exemplo n.º 4
0
        protected void Search_btn_Click(object sender, EventArgs e)
        {
            string            key     = this.search_box.Text.ToString();
            searching         s       = new searching();
            SqlDataAdapter    adapter = s.search(key);
            SqlCommandBuilder builder = new SqlCommandBuilder(adapter);



            DataSet ds = new DataSet();

            //adapter.Fill(ds, "Books");
            adapter.Fill(ds, "Books");
            ds.Tables["Books"].PrimaryKey = new DataColumn[] { ds.Tables["Books"].Columns["BID"] };
            result_grid.DataSource        = ds.Tables["Books"];
            result_grid.DataBind();
        }