Its better if you use boolean AND operator as follow
if (if e.Row != null && e.Row.RowType == DataControlRowType.DataRow)
{
DataRowView drView = (DataRowView)e.Row.DataItem
{
DataTable dtChildTable1 = ((DataTable) Session["dtAll"])
if(dtChildTable1 != null)
{
DataTable dtNew = dtChildTable1.Select("ID=" + Convert.ToInt32( drView["ID"])).CopyToDataTable()
}
}
}
Or <br />
you can create a reference to the DataRow[] Array instead of dtNew variable of or better to use var