I wish to have an If statement in my code, which tests if any results are obtained from my SQL query. I have tried looking on Google but have not found any effective way to test this.
My code at the moment always goes into the If block and tried to display the page. What have I done wrong ?
var pendingMeetings = db.Query("SELECT * FROM table");
if (pendingMeetings != null) {
//display page
} else {
<h1>No results found!</h1>
}
try