dynamic label

                QueryBuilderManager qb = new QueryBuilderManager();
                DataTable d = new DataTable();
                string QBClauseScript = loadCondition();
                d = DatabaseConnection.CreateDataset(QBClauseScript.ToString(), QBConnStr).Tables[0];

 

                this.LblResultCount.ForeColor = Color.Black;
                int rows = d.Rows.Count;
                this.LblResultCount.Text = String.Format(“{0} Record{1} found{2}”,
                                                         rows, rows == 1 ? ” was” : “s were”, rows == 0 ? “.” : “:”);

                DataView dm = new DataView();
                dm = d.DefaultView;
                Session[“Block”] = d;

                GridView1.DataSource = dm;
                GridView1.DataBind();
                this.GridView1.Visible = (rows > 0);

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: