private void BindData() { ArrayList ParameterList = new ArrayList(); ParameterList.Clear(); ParameterList.Add(SLP_VENDOR_S.Text); ParameterList.Add(SLP_VENDOR_E.Text); ParameterList.Add(SLP_ITEM_S.Text); ParameterList.Add(SLP_ITEM_E.Text); ParameterList.Add(SLP_CREATEDATE.StartDate); ParameterList.Add(SLP_CREATEDATE.EndDate); ParameterList.Add(SLP_CREATEUID.Text); ParameterList.Add(SLP_UPDATEDATE.StartDate); ParameterList.Add(SLP_UPDATEDATE.EndDate); ParameterList.Add(SLP_UPDATEUID.Text); ParameterList.Add(TextBoxRowCountLimit.Text); VAM28_BCO BCO = new VAM28_BCO(ConntionDB); DataTable dt = BCO.QueryOilSubsidyByFind(ParameterList); string SessionIDName = "VAM281_" + PageTimeStamp.Value; Session[SessionIDName] = dt; GridView1.DataSource = dt; GridView1.PageSize = (TextBoxPagesize.Text == "") ? 20 : (int.Parse(TextBoxPagesize.Text) < 0) ? 20 : int.Parse(TextBoxPagesize.Text); GridView1.PageIndex = 0; GridView1.DataBind(); if (dt.Rows.Count > 0) { StringCollection sc = new StringCollection(); foreach (DataRow dr in dt.Rows) { sc.Add(dr["ID"].ToString()); } Session["VAM28CodeCollection" + PageTimeStamp.Value] = sc; } else { ErrorMsgLabel.Text = "查無資料"; } }