aspvijay04 says:
protected
void
GridView6_RowDataBound(
object
sender, GridViewRowEventArgs e)
{
if
(e.Row.RowType == DataControlRowType.DataRow)
{
Label lblpend = (Label)e.Row.FindControl(
"lblpenmdi"
);
c.cmd.CommandText =
"select * from cgrs_feedback where mddos is null and status=1 and assignofficer is not null"
;
c.da.Fill(c.ds3,
"pendmd"
);
if
(c.ds3.Tables[
"pendmd"
].Rows.Count > 0)
{
lblpend.Visible =
true
;
}
}
}
Replace the above with the below. You need to get the dataset from database.
protected void GridView6_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
// Get DataSet from DataBase.
DataSet ds3 = new DataSet();
DataTable cgrs_feedback = new DataTable("pendmd");
cgrs_feedback.Columns.AddRange(new DataColumn[2] { new DataColumn("Id"), new DataColumn("f_id") });
cgrs_feedback.Rows.Add("1", "4");
ds3.Tables.Add(cgrs_feedback);
Label lblpend = (Label)e.Row.FindControl("lblpenmdi");
Label lblcomd = (Label)e.Row.FindControl("lblcommdi");
if (ds3.Tables["pendmd"].Rows.Count > 0)
{
lblpend.Visible = true;
}
else
{
lblcomd.Visible = true;
}
}
}