title: retrieving data from the database and comparing the retrieved result in asp.net c#
body: <pre><code>string strCon = ConfigurationManager.ConnectionStrings["conCTSystem"].ConnectionString;
  SqlConnection conSchedule = new SqlConnection(strCon);
  
  conSchedule.Open();
  
  SqlCommand cmdSchedule = new SqlCommand("Select Day From Schedule Where RoomNumber=@roomNumber", conSchedule);
  cmdSchedule.Parameters.AddWithValue("@roomNumber", ddlRoomNumber.SelectedValue); //MatchWithDropDownList
  
  using (SqlDataAdapter da = new SqlDataAdapter(cmdSchedule))
  {
      DataSet ds = new DataSet();
      da.Fill(ds);
  
      if (ds.Tables.Count &gt; 0)
      {
         string ReturnDay = ds.Tables[0].Rows[0]["Day"].ToString();
  
         if (ReturnDay == "Monday")
         {
            Label1.Text = "abc";
         }
         else
         {
            Label1.Text = "cde";
         }
      }
   }   
  </code></pre>
  
  <p>Can anyone help me for solve this problem? I am a new learner for using asp.net c# and I face the problem is when the <code>ReturnDay</code> is equal to <code>Monday</code> and should displaying the "abc" result but the output is show to me was "cde".</p>