title: Get values from joined tables using SqlDataReader
body: <p>Imagine we have two tables in the database, <code>user</code> (FK id_role) and <code>role</code> (PK role). We need to read information about user and his privileges.</p>
  
  <p>I use the following SQL statement to perform query:</p>
  
  <pre><code>SELECT * 
  FROM [user] 
  INNER JOIN role ON [user].id_role = role.id 
  WHERE login = @login
  </code></pre>
  
  <p>After executing, I try to read values in reader using string indexer: <code>reader[string name]</code>. </p>
  
  <p>The problem which I need to resolve is repeating names: both <code>user</code> and <code>role</code> contain, e.g., the field <code>id</code>, which I am able to read for user (using <code>reader["id"]</code>), but not able to read for role (using <code>reader["role.id"]</code>). </p>
  
  <p>The property <code>FieldCount</code> returns 12, which means that all required fields were read (<code>user</code> contains 6 fields, so does <code>role</code>). </p>
  
  <p>Do I have a possibility to read columns by name in this case? Or using two queries or SQL 'as' operator in the only way?</p>