protected void Button2_Click(object sender, EventArgs e) { if (TextBox3.Text != "") { if (DropDownList1.Text == "图书编号") { Bll.BookTable bBor = new Bll.BookTable(); this.GridView1.DataSource = bBor.select("BookId like '%" + TextBox3.Text + "%'"); this.GridView1.DataKeyNames = new string[] { "BookId" }; this.GridView1.DataBind(); } if (DropDownList1.Text == "图书名称") { Bll.BookTable bBor = new Bll.BookTable(); this.GridView1.DataSource = bBor.select("BookName like '%" + TextBox3.Text + "%'"); this.GridView1.DataKeyNames = new string[] { "BookId" }; this.GridView1.DataBind(); } if (DropDownList1.Text == "出版社名称") { Bll.BookTable bBor = new Bll.BookTable(); this.GridView1.DataSource = bBor.select("BookPress like '%" + TextBox3.Text + "%'"); this.GridView1.DataKeyNames = new string[] { "BookId" }; this.GridView1.DataBind(); } this.Label4.Text = ""; } else { this.Label4.Text = "不能为空"; } }
public void bang() { Bll.BookTable books = new Bll.BookTable(); GridView1.DataSource = books.select(""); GridView1.DataKeyNames = new string[] { "BookId" }; GridView1.DataBind(); }
public void bind() { Bll.BookTable book = new Bll.BookTable(); DataTable da = book.select("BookId='" + Request.QueryString["name"] + "'"); txt_bookid.Text = Request.QueryString["name"]; txt_bookname.Text = da.Rows[0]["BookName"].ToString().Trim(); }
public void bang() { Bll.BookTable book = new Bll.BookTable(); DataTable da = book.select("BookynMake='" + "否" + "'"); GridView1.DataSource = da; GridView1.DataKeyNames = new string[] { "BookId" }; GridView1.DataBind(); }
protected void Button2_Click(object sender, EventArgs e) { if (TextBox3.Text != "") { Bll.BookTable bBor = new Bll.BookTable(); this.GridView1.DataSource = bBor.select("BookynMake like '%" + TextBox3.Text + "%'"); this.GridView1.DataKeyNames = new string[] { "BookynMake" }; this.GridView1.DataBind(); this.Label4.Text = ""; } else { this.Label4.Text = "不能为空"; } }
public void bang() { DropDownList grid; Bll.BookTable books = new Bll.BookTable(); DataTable da = books.select(""); GridView1.DataSource = da; GridView1.DataKeyNames = new string[] { "BookId" }; GridView1.DataBind(); for (int i = 0; i < GridView1.Rows.Count; i++) { DataRowView mydiv = da.DefaultView[i]; grid = (DropDownList)GridView1.Rows[i].FindControl("DropDownList2"); grid.Text = da.Rows[i]["BookPress"].ToString(); grid.Enabled = false; grid = (DropDownList)GridView1.Rows[i].FindControl("DropDownList1"); grid.Text = da.Rows[i]["BookCategory"].ToString(); grid.Enabled = false; //grid.SelectedIndex = grid.Items.IndexOf(grid.Items.FindByText(da.Rows[i]["BookPress"].ToString())); } }