I have two records in the Database Record 1 and Record 2. The datareader will return guid value for record 1 and the code works fine. But on record 2 the datareader will return "". My question is How can I add String Empty without the exception, the two options both error. Immediate Win
?dataReader["Id"].GetType().FullName
"System.Guid"
Code
while (dataReader.Read())
{
d.id = new Guid(dataReader["Id"].ToString());
//Guid.TryParse(dataReader["Id"]?.ToString(), out d.Id)
}