コード例 #1
0
        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(); 
        }
コード例 #2
0
        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();
        }
コード例 #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();
        }
コード例 #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();
        }