I want to use a SELECT statement to get data from MYSQL DB and store it into a DataTable. Then I want to use the data in ASP.NET C#. The problem is that if there is any NULL or empty data it crashes the program. Is there anyway to set a DEFAULT value such as ‘0’ or something when a record/cell is empty?
For example “SELECT testID, userID, testScore FROM tableTestResults” but sometimes testScore is null because it was never done. Im wondering if u can set a default value for testScore whether there is a score or not.
The other example sometimes u get a null when COUNT is used, can I set a default value for that too?
If you specifically have
NULLthere –IFNULLwill help you