title: Into what C# data type should I retrieve a SQL Server UNIQUEIDENTIFIER?
body: <p>I have a table like</p>
  
  <pre><code>CREATE TABLE Partners 
  (
      id UNIQUEIDENTIFIER NOT NULL DEFAULT NEWID(),
      name NVARCHAR(50) NOT NULL,
      email NVARCHAR(254) NOT NULL, -- 254 is optimal length according to http://stackoverflow.com/questions/1199190/what-is-the-optimal-length-for-an-email-address-in-a-database
      PRIMARY KEY (id)
  );
  </code></pre>
  
  <p>and a simple stored procedure:</p>
  
  <pre><code>CREATE PROCEDURE GetPartnersWithIds
  AS
      SELECT id, name 
      FROM Partners;
  </code></pre>
  
  <p>The result of which I'm trying to reading into a <code>List&lt;PartnerWithId&gt;</code> where <code>PartnerWithId</code> is defined by </p>
  
  <pre><code>public class PartnerWithId
  {
      public Guid Id { get; set; }
      public string Name { get; set; }
  } 
  </code></pre>
  
  <p>My method for doing so is</p>
  
  <pre><code>    public List&lt;PartnerWithId&gt; GetPartners ( )
      {
          List&lt;PartnerWithId&gt; Partners = new List&lt;PartnerWithId&gt;();
  
          using (SqlCommand cmd = new SqlCommand("GetPartnersWithIds", this._Conn))
          {
              cmd.CommandType = CommandType.StoredProcedure;
              this._Conn.Open();
  
              using (SqlDataReader dataReader = cmd.ExecuteReader())
              {
                  while (dataReader.Read())
                  {
                      Partners.Add(new PartnerWithId {
                          Id = (Guid)dataReader.GetString(0),
                          Name = dataReader.GetString(1)
                      });
                  }
              }
              this._Conn.Close();
          }
          return Partners;
      }
  </code></pre>
  
  <p>but I'm getting an error</p>
  
  <blockquote>
    <p>Cannot convert type <code>string</code> to <code>System.Guid</code></p>
  </blockquote>
  
  <p>on chunk <code>(Guid)dataReader.GetString(0)</code> (which was really just a guess). What is the correct way to get this value?</p>