I am trying to read my database. I have an column stores int values or null values. When I try to read this column i normally use this line of code;
int Score = Convert.ToInt32(reader["Score"]);
but it can be null. So i cant convert it to int. Then I tried ;
bool tryGetScore = int.TryParse(reader["Score"], out player1Score);
but i cant parse this value neither. It says "Cannot convert from 'Object' to 'System.ReadOnlySpan'"
How can i read this value. Whenever i face a null, my program crashes