title: How can I read string value and store it in a array using data reader
body: <p>I am reading some list of values in the result but I am not sure where I am going wrong, I wont know the array size so I cant assign any value to it</p>
  
  <pre><code>string[] result = null;
  while (reader.Read())
  {
      result = Convert.ToString[](reader["RoleID"]);
  }
  reader.Close();
  </code></pre>
  
  <p>I am getting: <code>Syntax error; value expected</code>.</p>
  
  <p>After I get the result value, how can I compare the values inside the result with a string? For example, I want to check whether the string <code>check="Can send message";</code> is present in the result array or not. How can I do that?</p>