Either
dtempdetail
or the
Rows
collection are null. Since only you can run this under the debugger, it's up to you to determine which is null and how to fix it. I would probably do this:
dtempdetail = lib.getemployDetail(sCompany, sEmp_name);
<big>if (dtempdetail != null)
{</big>
if (dtempdetail.Rows.Count > 0)
{
grdJobHistory.DataSource = dtempdetail;
grdJobHistory.DataBind();
}
<big>}</big>