string strConn;
string billorder;
strConn = WebConfigurationManager.ConnectionStrings["My_data"].ConnectionString;
SqlConnection Conn = new SqlConnection(strConn);
Conn.Open();
string showname;
showname = "SELECT order_sale.id_cus,order_sale.date,register_customer.name_cus,register_customer.address_cus,register_customer.tel_cus,bill.address_sent,bill.name_sent,order_sale.id_bill FROM bill,register_customer,order_sale WHERE register_customer.id_cus = order_sale.id_cus AND order_sale.id_bill = '" + Session["id_bill"] + "' AND bill.id_bill = order_sale.id_bill ";
SqlDataAdapter da1 = new SqlDataAdapter(showname, Conn);
DataSet ds1 = new DataSet();
da1.Fill(ds1, "bill");
//ReportDocument rd = new ReportDocument();
//rd.Load(Server.MapPath("CRbill_order.rpt"));
//rd.SetDataSource(ds1.Tables["bill"]);
//CrystalReportViewer1.ReportSource = rd;
Lid_cus.Text = ds1.Tables[0].Rows[0][0].ToString();
Ldate.Text = ds1.Tables[0].Rows[0][1].ToString();
Lname.Text = ds1.Tables[0].Rows[0][2].ToString();
Laddress.Text = ds1.Tables[0].Rows[0][3].ToString();
Ltel.Text = ds1.Tables[0].Rows[0][4].ToString();
Label1.Text = ds1.Tables[0].Rows[0][5].ToString();
Label2.Text = ds1.Tables[0].Rows[0][6].ToString();
Lidbill.Text = ds1.Tables[0].Rows[0][7].ToString();
billorder = "SELECT order_sale.id_product,product.name_product,order_sale.saleproduct,order_sale.amount,order_sale.mix FROM order_sale,product WHERE id_bill = '" + Session["id_bill"] + "' AND order_sale.id_product = product.id_product ";
SqlDataAdapter da = new SqlDataAdapter(billorder, Conn);
DataSet ds = new DataSet();
da.Fill(ds, "product");
Gv_bill.DataSource = ds.Tables["product"];
Gv_bill.DataBind();
//ReportDocument rd1 = new ReportDocument();
//rd1.Load(Server.MapPath("CRbill_order.rpt"));
//rd1.SetDataSource(ds.Tables["product"]);
//CrystalReportViewer1.ReportSource = rd1;
ส่วนของ data set ดังนี้คับ แล้วจะ เขียน โค๊ดยังไงคับ
