I'm constant receive the error:
Additional information: Data is Null. This method or property cannot be called on Null values.
When I try to receive information. How can I check if the datareader is empty.
for example this is my code:
while (rd.Read())
{
if (rd.HasRows)
{
foundInformation[0] = rd.GetString(0);
foundInformation[1] = rd.GetString(1);
}
else
{
foundInformation[0] = "nvt";
foundInformation[1] = "nvt";
}
}
How can I check if rd.GetString(0) is empty?
Thankyou.