title: How To Compare a Textbox With An Array in C#
body: <p>I'm pretty new in C# and i couldn't find an answer for this.
  I'm getting the values of a column named NUMERO_CTA from my DB in an array within valores variable. But I have to compare this array of values with a textbox to check if one of the values contained in valores matches with the value of the textbox named txtCuentaDestino. How can I compare a textbox.text with an array?. Thanks in advanced!
  Here's my code:</p>
  
  <pre><code> DataTable tbl = ds.Tables[0];
       for (int i = 0; i &lt; tbl.Rows.Count; i++)
       {
          DataRow myRow = tbl.Rows[i];
          valores = new string[] {myRow["NUMERO_CTA"].ToString()};  
       }
  
       if (ds.Tables[0].Rows.Count == 0)
       {
          GuardaCuenta();
          return false;
       }
       else if (txtCuentaDestino.Text == resultado)
       {
          return true;
       }
       else
       {
          return false;
       }
  </code></pre>