Share via

Problem with Azure Database for MySQL

Lab Emersive 0 Reputation points
2023-07-21T10:39:58.4466667+00:00

I receive this message:

InvalidCastException: Unable to cast object of type 'System.DBNull' to type 'System.String'.

MySqlConnector.MySqlDataReader.GetString(int ordinal) in MySqlDataReader.cs, line 287

Azure Database for MySQL
Developer technologies | .NET | Other
{count} votes

1 answer

Sort by: Most helpful
  1. Bogdan Florea 125 Reputation points
    2023-07-25T06:48:21.2266667+00:00

    Do you have nullable reference types enabled? If so, you might need to change your model correspondingly.

    2 people found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.