title: DataTable DataView - Bit Value in Database
body: <p>I have read a database table into a DataTable in my C# program, but I am having a few issues assigning the column which contains a bit value to a Boolean.</p>
  
  <p>Here is my code so far:</p>
  
  <pre><code>            // Load and Sort Users DataTable
          DataTable datatableUsers = UserMethods.GetUsers().Tables["Users"];
          datatableUsers.DefaultView.Sort = "Name";
  
          // Filter Based on Search Box
          datatableUsers.DefaultView.RowFilter = "Name LIKE '%" + user + "%' OR Username LIKE '%" + user + "%'"; ;  
          DataView dataviewUsers = datatableUsers.DefaultView;
  
          // Loop Through Rows and Add UsersGrid to FlowLayoutPael
          foreach (DataRowView datarowviewUsers in dataviewUsers)
          {
              var UsersGrid = new UsersGrid
              {
                  ID = (int)datarowviewUsers["ID"],
                  Username = datarowviewUsers["Username"].ToString(),
                  User = datarowviewUsers["Name"].ToString(),
                  Admin = datarowviewUsers["Administrator"].ToString(),
              };
              flowlayoutpanelUsers.Controls.Add(UsersGrid);
              UsersGrid.WasClicked += UsersGrid_WasClicked;
          }
  </code></pre>
  
  <p>At the moment I am converting the Admin ToString and matching on "True" but that is getting very messy and I would prefer to set Admin to type Boolean.  What do I need to do?</p>