title: asp.net error: Cannot implicitly convert type 'object' to 'string'. An explicit conversion exists (are you missing a cast?)
body: <p>I want to retrieve data from a table in sql server called hotel using select WHERE statement and I get the above error. Can anyone help?</p>
  
  <pre><code>SqlConnection cnn = new
          SqlConnection(ConfigurationManager.ConnectionStrings["myConnectionString"].ToString());
  cnn.Open();
  SqlCommand cmd = new SqlCommand();
  cmd.CommandText = "SELECT RoomsAvailable FROM Hotel WHERE HotelName = '" + 
                      this.DropDownList1.Text + "'";
  cmd.Connection = cnn;
  SqlDataAdapter da = new SqlDataAdapter();
  da.SelectCommand = cmd;
  DataSet ds = new DataSet();
  da.Fill(ds, "Hotel");
  SqlCommandBuilder cb = new SqlCommandBuilder(da);
  DataRow dsRow = null;
  foreach (DataRow dsRow_loopVariable in ds.Tables["Hotel"].Rows)
  {
      dsRow = dsRow_loopVariable;
      //This line is where the error comes in.
      this.txtHotel.Text = (dsRow["RoomsAvailable"]);
  }
  </code></pre>