GridView No Records
DataTable dt = new DataTable();
if (dt.Rows.Count > 0)
{
GridView1.DataSource = dt;
GridView1.DataBind();
}
else
{
DataTable dtOne = new DataTable("MyFirstTable");
dtOne.Columns.Add("Number");
DataRow row = dtOne.NewRow();
row["Number"] = "No Records";
dtOne.Rows.Add(row);
GridView1.DataSource = dtOne;
GridView1.DataBind();
}
DataTable dt = new DataTable();
if (dt.Rows.Count > 0)
{
GridView1.DataSource = dt;
GridView1.DataBind();
}
else
{
DataTable dtOne = new DataTable("MyFirstTable");
dtOne.Columns.Add("Number");
DataRow row = dtOne.NewRow();
row["Number"] = "No Records";
dtOne.Rows.Add(row);
GridView1.DataSource = dtOne;
GridView1.DataBind();
}