title: Check string value from database
body: <p>I am haveing strange issue comparing string value. I have a value in SQL with type (nchar) this value equals "text". And I set this value to string variable x, after that I compared the string variable x with the word "text" .</p>
  
  <p>The problem is it shows that x doesn't equal the value "text" even that when I add x value to label, it shows the word "text".</p>
  
  <p>Here is my code:</p>
  
  <pre><code>string x;
  using (SqlCommand cmd = new SqlCommand(
         "select column from text_table where  column = 'text'", sqlCon))
  {
      using (SqlDataReader reader = cmd.ExecuteReader())
      {
          if (reader.Read())
          {
              x = reader["column"].ToString();
  
              if (x.Equals("text"))
              {
                  // run code  
              }
              else
              {
                  label1.Text ="x doesn't equal text";
              }
  </code></pre>
  
  <p>when I use the code it always shos the message "x doesn't equal text" but it should run the code as the value of the string x is "text"</p>