示例#1
0
        private void DataBind()
        {
            PatientDataTier aDatatier = new PatientDataTier();

            ViewState["vpatid"] = txtPatientID.Text.Trim();


            DataSet aDataSet = new DataSet();

            aDataSet = aDatatier.GetPatient(Convert.ToString(ViewState["vpatid"]));

            grdPatient.DataSource = aDataSet.Tables[0];

            // Cache for a while
            if (Cache["PatientData"] == null)
            {
                Cache.Add("PatientData", new DataView(aDataSet.Tables[0]),
                          null, System.Web.Caching.Cache.NoAbsoluteExpiration, System.TimeSpan.FromMinutes(10),
                          System.Web.Caching.CacheItemPriority.Default, null);
            }
            grdPatient.DataBind();
        }