Example #1
0
        private void bsearch_Click(object sender, EventArgs e)
        {
            // Execute the query again
            string       searchname = param.SearchDataset;
            DataInfo     dinfo      = report.DataInfo[searchname];
            DatabaseInfo dbinfo     = report.DatabaseInfo[dinfo.DatabaseAlias];

            if (param.SearchParam.Length > 0)
            {
                report.Params[param.SearchParam].Value = textsearch.Text;
                ptop.Visible = true;
            }
            else
            {
                ptop.Visible = false;
            }
            IDataReader    areader = dbinfo.GetDataReaderFromSQL(dinfo.SQL, dinfo.Alias, report.Params, false);
            PagedDataTable atable  = new PagedDataTable();

            atable.CurrentReader = areader;
            if (dgrid.DataSource == null)
            {
                dgrid.TableStyles.Add(DataShow.CreateDataGridStyle(atable, dgrid));
            }
            dgrid.DataSource = atable;
        }