title: add a column of checkboxes to a grid that will update a field in a database
body: <p>I have a GridView holding my order table that aappears on my docor page (these are inserted values from an insert statement) - this is the select statement:</p>
  
  <pre><code>Create View docgridview 
  As 
  
  Select A.OrderID
    ,A.DoctorId,B.Forename,B.Surname ,A.MedicineId,C.Name      as      MedicineName,D.pharmname,A.Dateordered, Approved
  From  order_pres  A
  Left  Join Patient   B on (A.PatientId  = B.PatientId)
  Left  Join Medicine  C on (A.MedicineId = C.MedicineId)
  Left  Join pharmacy  D on (A.PharmacyId   = D.PharmacyId)
  Left  Join Doctor    E on (A.DoctorId  = E.DoctorId)
  </code></pre>
  
  <p>Docgridview is then used to bind the statement to the gridview:</p>
  
  <pre><code> If Not IsPostBack Then
          Dim conn As New System.Data.SqlClient.SqlConnection("Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\surgerydb.mdf;Integrated Security=True;Connect Timeout=30")
          Dim cmd3string As String = " Select * From docgridview  WHERE DoctorId = " &amp; Session("DoctorId")
          Dim dt As New System.Data.DataTable()
          Dim da As New System.Data.SqlClient.SqlDataAdapter(cmd3string, conn)
          conn.Open()
          da.Fill(dt)
          conn.Close()
  
          GridViewdoc.DataSource = dt
          GridViewdoc.DataBind()
      End If
  </code></pre>
  
  <p>How do I add a column of check boxes to a GridView that would update the column approved from the order_pres  'approved' if checked and 'disapproved' if not checked on the button . click</p>
  
  <p>the grid view:</p>
  
  <pre><code>&lt;asp:GridView ID="GridViewdoc" runat="server"  &gt;
  
  &lt;/asp:GridView&gt;
  
  
  &lt;asp:Button ID="btnapprove" runat="server" Text="Button" /&gt;
  </code></pre>
  
  <p>The table that will update:</p>
  
  <p><a href="https://i.stack.imgur.com/dI5jI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dI5jI.png" alt="enter image description here"></a></p>