title: Edit the values returned from an SQL Query
body: <p>For a project I am working on I have this OwnershipRole record:</p>
  <pre><code>public record OwnershipRole
  {
  
      public OwnershipRole()
      {
  
      }
  
      public OwnershipRole(Guid id, string title, bool isWithdrawn)
      {
          Id = id;
          Title = title;
          IsWithdrawn = isWithdrawn;
      }
  
      public Guid Id { get; set; }
      public string Title { get; set; }
      public bool IsWithdrawn { get; set; }
  }
  }
  </code></pre>
  <p>For getting these details I am using an sql query like so:</p>
  <pre><code>    public List&lt;OwnershipRole&gt; GetOwnershipRoles()
      {
  
          var sql = @&quot;
  SELECT ItemID, Title, Status
  FROM ItemDetail&quot;;
  
  
          var data = GetTable(sql);
  
          return data.Select().Select(dr =&gt; new OwnershipRole
          {
              Id = dr.Field&lt;Guid&gt;(0),
              Title = dr.Field&lt;string&gt;(1),
              IsWithdrawn = !dr.Field&lt;bool&gt;(2)
          }).ToList();
      }
  
      private DataTable GetTable(string sql)
      {
          var rv = new DataTable();
          using var cnn = new SqlConnection(_connectionString);
          using var cmd = new SqlCommand(sql, cnn);
          cnn.Open();
  
          var da = new SqlDataAdapter(cmd);
          da.Fill(rv);
      
          cnn.Close();
          return rv;
      }
  </code></pre>
  <p>We are grabbing the results and putting them into a data table. The issue I am having however is that the values from the column Status are actually strings. So I am wondering is it possible have a condition of something like:</p>
  <pre><code>if (Status == &quot;Withdrawn&quot;) {
  Status == false
  
  }
  </code></pre>
  <p>I know that won't work but is there a way I can manipulate the values that I get from the Status column in order to fit in with the bool parameter in the OwnershipRole class?</p>