title: Binding a customized DataGridView with SQL Server database
body: <p>I'm currently writing a WinForms application and I want to use a <code>DataGridView</code>. I know how to bind the <code>DataGridView</code> with a table in database like this:</p>
  
  <pre><code>using (SqlConnection con = new SqlConnection(WF_AbsPres.Properties.Settings.Default.DbConnectionString))
  {
      SqlDataAdapter a = new SqlDataAdapter("SELECT * FROM DevInOut", con);
      SqlCommandBuilder comdBuilder = new SqlCommandBuilder(a);
  
      DataTable t = new DataTable();
      //t.Locale = System.Globalization.CultureInfo.InvariantCulture;
      a.Fill(t);
  
      //dataGridView1.AutoGenerateColumns = false;
  
      bindingSource1.DataSource = t;
  
      /// bind the grid view with binding source
      dataGridView1.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCellsExceptHeader);
      dataGridView1.ReadOnly = true;
      dataGridView1.DataSource = bindingSource1;
  
      dataGridView1.DataSource = t;
      con.Close();
  }
  </code></pre>
  
  <p>But the thing is in this way the <code>dataGridView</code> shows all the columns of the table. I want to add the columns in dataGridViewmanually and bind each one to a specific column in the database table. It means I don't want some columns to be shown.</p>
  
  <p>How can I do that? Thanks</p>