protected void Search_Click(object sender, EventArgs e) { //***** GET DATASET Koneksi cn = new Koneksi(); DataSet ds = new DataSet(); string date1 = TxtAwal.Text; DateTime formattedtime1 = DateTime.ParseExact(date1, "dd/MM/yyyy", CultureInfo.InvariantCulture); string date2 = TxtAkhir.Text; DateTime formattedtime2 = DateTime.ParseExact(date2, "dd/MM/yyyy", CultureInfo.InvariantCulture); string sql = "Select * from Stock where TglDatang >= '" + date1 + "' and TglDatang <= '" + date2 + "' "; ds = cn.getDataSet(sql); ListViewMasterStock.DataSource = ds; ListViewMasterStock.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (Session["Member_ID"] == null) { Response.Redirect("~/Login.aspx"); } ListViewMasterStock.DataSource = null; ListViewMasterStock.DataBind(); //***** GET DATASET //Koneksi cn = new Koneksi(); //DataSet ds = new DataSet(); //string sql = "Select * from Stock"; //ds = cn.getDataSet(sql); //ListViewMasterStock.DataSource = ds; //ListViewMasterStock.DataBind(); }