Hi Dear,
Please make sure that your DataTable is not null.
Please use below condition for check
If(dat != null && dat.Rows.Count>0)
{
LblCountryName.Text = dat.Rows[0][0].ToString();
}
else
{
LblCountryName.Text = "DataTable is null or Not Contain Any Row(s).";
}
Thanks