Move the declaration of "dTable" outside the
try
block:
private DataTable BindGrid()
{
PersonBAL3 p = new PersonBAL3();
DataTable dTable = null;
try
{
dTable = p.Load();
GridView1.DataSource = dTable;
GridView1.DataBind();
}
catch (Exception ee)
{
lblMessage.Text = ee.Message.ToString();
}
finally
{
p = null;
}
return dTable;
}