display data from tables that contain a null value
- by user2631662
I need the code below to say - if myReader reads a null entry a new method is called. At the moment it will not display data from tables that contain a null value
conDataBase.Open();
myReader = cmdDataBase.ExecuteReader();
while (myReader.Read())
{
if (myReader["Code_CodeID"] != DBNull.Value)
{
string sFirst = myReader["First"].ToString();
string sLast = myReader["Last"].ToString();
string sAdd1 = myReader["Address1"].ToString();
string sCode = myReader["Code"].ToString();
txtFirst.Text = sFirst;
txtSecond.Text = sLast;
txtadd1.Text = sAdd1;
txtDeviceIMEI.Text = sCode;
}
}
}
else
{
//go to a new method
}
}