Dear all I have a code
if (findCNIC != null)
{
if (findCNIC.DISTRICT.ToUpper() == "ABC")
{
district = "NEW";
}
else if (findCNIC.TEHSIL.ToUpper() == "ZHS" || findCNIC.TEHSIL.ToUpper() == "BHHH")
{
district = "old";
}
else if (findCNIC.TEHSIL.ToUpper() == "NO" || findCNIC.TEHSIL.ToUpper() == "NO")
{
district = "mid";
}
else { district = findCNIC.DISTRICT.ToUpper(); }
}
Now I wanted to check findCNIC.TEHSIL is not null above to this else if
else if (findCNIC.TEHSIL.ToUpper() == "ZHS" || findCNIC.TEHSIL.ToUpper() == "BHHH")
how to do that because I am getting exception when tehsil is coming null , remember I want to check this condition with else if not with main if.