You can create this kind of function if your dataset not return any value from database.
public void DynamicTable()
{
string Id = "id";
string Name = "name";
DataTable dt = new DataTable();
DataColumn dc1 = new DataColumn(Id,typeof(System.String));
dt.Columns.Add(dc1);
DataColumn dc2 = new DataColumn(Name, typeof(System.String));
dt.Columns.Add(dc2);
DataRow dr = dt.NewRow();
dr["id"] = "No Record";
dr["name"] = "No Record";
dt.Rows.Add(dr);
GridView1.DataSource = dt;
GridView1.DataBind();
}