I inherited some C# code behind that queries a database table and need to add something that displays a "No results" message (using a Label web control, perhaps) if the query doesn't return any records.
I'm just learning C# but am coming up short on how to do this. Would anyone be kind enough to point me to an example, or demonstrate?
Thanks a lot.
Here's the code I inherited (the programmer who wrote this is no longer available). This is the code behind from the search results page:using System;
public partial class lodging_search_output : System.Web.UI.Page
protected void Page_Load(object sender, EventArgs e)
string sql = Session["logdingSearchSql"].ToString();
SqlCommand cmd = common.openDatabase();
cmd.CommandText = sql;
string PreviousTown = "";
StringBuilder sb = new StringBuilder();
SqlDataReader rdr = cmd.ExecuteReader();
View Complete Post