protected void Button4_Click(object sender, EventArgs e) { string connStr = ConfigurationManager.ConnectionStrings["DBCS"].ConnectionString; SqlConnection conn = new SqlConnection(connStr); string sql3 = "SELECT dvdid,title,description,actor,type,category,date FROM dvds dvd,casting cas,type tp, category ct where dvd.castingId=cas.id and dvd.typeid=tp.id and dvd.categoryid=ct.id and actor like '%" + TextBoxact.Text + "%'"; SqlDataAdapter adapter3 = new SqlDataAdapter(sql3, conn); SqlCommandBuilder builder3 = new SqlCommandBuilder(adapter3); DataSet ds = new DataSet(); adapter3.Fill(ds, "dvd3"); GridViewhome0.DataSource = ds.Tables["dvd3"]; GridViewhome0.DataBind(); }
protected void searchbtn_Click(object sender, EventArgs e) { string connStr = ConfigurationManager.ConnectionStrings["DBCS"].ConnectionString; SqlConnection conn = new SqlConnection(connStr); string sql2 = "SELECT dvdid,title,description,actor,type,category,date FROM dvds dvd,casting cas,type tp, category ct where dvd.castingId=cas.id and dvd.typeid=tp.id and dvd.categoryid=ct.id and title like '%" + TextBoxsrc.Text + "%'"; SqlDataAdapter adapter2 = new SqlDataAdapter(sql2, conn); SqlCommandBuilder builder2 = new SqlCommandBuilder(adapter2); DataSet ds = new DataSet(); adapter2.Fill(ds, "dvd2"); Cache["DATASET"] = ds; Cache["ADAPTER2"] = adapter2; GridViewhome0.DataSource = ds.Tables["dvd2"]; GridViewhome0.DataBind(); }