protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string id = Request.QueryString["dethi"].ToString(); string sql_dethi = "select Tende from DETHI where Made='" + id + "'"; DataTable tb_dethi = ketnoi.getData(sql_dethi); txt_dethi.Text = tb_dethi.Rows[0][0].ToString().ToUpper(); txt_dethi2.Text = tb_dethi.Rows[0][0].ToString().ToUpper(); string sql_Phutnghe = "select * from DONGHO where IDDongho='03'"; rpt_dongho.DataSource = ketnoi.getData(sql_Phutnghe); rpt_dongho.DataBind(); string sql_docdientu = "select * from CAUHOI where IDNoidung='DoublePassage'"; Rpt_nghe.DataSource = ketnoi.getData(sql_docdientu); Rpt_nghe.DataBind(); for (int i = 0; i < Rpt_nghe.Items.Count; i++) { Label a = (Label)Rpt_nghe.Items[i].FindControl("A"); Label b = (Label)Rpt_nghe.Items[i].FindControl("B"); Label c = (Label)Rpt_nghe.Items[i].FindControl("C"); Label d = (Label)Rpt_nghe.Items[i].FindControl("D"); try { string sql = "select * from DAPAN where IDCauhoi ='1_Double_" + (i + 1) + "'"; DataTable tb = ketnoi.getData(sql); a.Text = tb.Rows[0]["NDDA"].ToString(); b.Text = tb.Rows[1]["NDDA"].ToString(); c.Text = tb.Rows[2]["NDDA"].ToString(); d.Text = tb.Rows[3]["NDDA"].ToString(); } catch {} } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string id = Request.QueryString["dethi"].ToString(); string sql_dethi = "select Tende from DETHI where Made='" + id + "'"; DataTable tb_dethi = ketnoi.getData(sql_dethi); txt_dethi.Text = tb_dethi.Rows[0][0].ToString().ToUpper(); txt_dethi2.Text = tb_dethi.Rows[0][0].ToString().ToUpper(); string sql_Phutnghe = "select * from DONGHO where IDDongho='03'"; rpt_dongho.DataSource = ketnoi.getData(sql_Phutnghe); rpt_dongho.DataBind(); string sql_hinhanh = "select A.IDCauhoi,C.IDNoidungchitiet, A.Phancauhoi, RTRIM(B.Tenfile)as Tenfile,A.Noidung from CAUHOI A, FILES B, CHITIETNOIDUNG C where A.IDNoidung='Conversation' and C.IDNoidungchitiet=A.IDNoidung and A.IDFile=B.IDFile and A.Made='" + id + "' order by A.IDCauhoi ASC"; Rpt_nghe.DataSource = ketnoi.getData(sql_hinhanh); Rpt_nghe.DataBind(); for (int i = 0; i < Rpt_nghe.Items.Count; i++) { Label a = (Label)Rpt_nghe.Items[i].FindControl("A"); Label b = (Label)Rpt_nghe.Items[i].FindControl("B"); Label c = (Label)Rpt_nghe.Items[i].FindControl("C"); Label d = (Label)Rpt_nghe.Items[i].FindControl("D"); string sql_idcauhoi = "select IDCauhoi from CAUHOI where IDNoidung='Conversation'"; DataTable tb_idcauhoi = ketnoi.getData(sql_idcauhoi); try { string sql = "select * from DAPAN where IDCauhoi ='" + tb_idcauhoi.Rows[i]["IDCauhoi"].ToString() + "'"; DataTable tb = ketnoi.getData(sql); a.Text = tb.Rows[0]["NDDA"].ToString(); b.Text = tb.Rows[1]["NDDA"].ToString(); c.Text = tb.Rows[2]["NDDA"].ToString(); d.Text = tb.Rows[3]["NDDA"].ToString(); } catch { } } try { DataTable tb_filenghe = ketnoi.getData(sql_hinhanh); filenghe = tb_filenghe.Rows[0]["Tenfile"].ToString(); } catch { } } }