title: select and update multiple checkbox in gridview
body: <p>I want to select multible record in one time and update them by a buttom</p>
  
  <p>I searched the internet by it's always cs and I want vb.net</p>
  
  <p>I did my grid view as following </p>
  
  <pre><code>&lt;asp:GridView ID="GridView1" runat="server" AutoGenerateCheckboxColumn="True"
  CheckboxColumnIndex="0" AllowSorting="true" 
                      AutoGenerateColumns="False" DataKeyNames="USER_ID" 
                      DataSourceID="SqlDataSource1StudentActivList" CellPadding="2"&gt;
                      &lt;Columns&gt;
  
                          &lt;asp:TemplateField ShowHeader="False"&gt;
                              &lt;ItemTemplate&gt;
                                  &lt;asp:CheckBox ID="CheckBox1" runat="server" /&gt;
                              &lt;/ItemTemplate&gt;
                          &lt;/asp:TemplateField&gt;
  
  
  
                          &lt;asp:BoundField DataField="FirstName" HeaderText="FirstName" 
                              SortExpression="FirstName" /&gt;
                          &lt;asp:BoundField DataField="LastName" HeaderText="LastName" 
                              SortExpression="LastName" /&gt;
                          &lt;asp:BoundField DataField="MiddleName" HeaderText="MiddleName" 
                              SortExpression="MiddleName" /&gt;
                          &lt;asp:BoundField DataField="ProgramCODE" HeaderText="ProgramCODE" 
                              SortExpression="ProgramCODE" /&gt;
                          &lt;asp:BoundField DataField="USER_NAME" HeaderText="USER_NAME" 
                              SortExpression="USER_NAME" /&gt;
                          &lt;asp:BoundField DataField="USER_Email" HeaderText="USER_Email" 
                              SortExpression="USER_Email" /&gt;
                          &lt;asp:BoundField DataField="MajorNameInEnglish" HeaderText="MajorNameInEnglish" 
                              SortExpression="MajorNameInEnglish" /&gt;
                          &lt;asp:BoundField DataField="GivenStudentID" HeaderText="GivenStudentID" 
                              SortExpression="GivenStudentID" /&gt;
                          &lt;asp:BoundField DataField="accepted" HeaderText="accepted" 
                              SortExpression="accepted" /&gt;
                          &lt;asp:BoundField DataField="Gender" HeaderText="Gender" 
                              SortExpression="Gender" /&gt;
                          &lt;asp:BoundField DataField="USER_ID" HeaderText="USER_ID" ReadOnly="True" 
                              SortExpression="USER_ID" /&gt;
                      &lt;/Columns&gt;
                      &lt;SelectedRowStyle BackColor="DarkSlateBlue" ForeColor="GhostWhite" /&gt;
                  &lt;/asp:GridView&gt;
  
  
  
                  &lt;asp:SqlDataSource ID="SqlDataSource1StudentActivList" runat="server" 
                      ConnectionString="&lt;%$ ConnectionStrings:mydbConnectionString %&gt;" 
                      SelectCommand="SELECT DISTINCT [FirstName], [LastName], [MiddleName], [ProgramCODE], [USER_NAME], [USER_Email], [MajorNameInEnglish], [GivenStudentID], [accepted], [Gender], [USER_ID] FROM [DIP_StudentsActivationList]"&gt;
                  &lt;/asp:SqlDataSource&gt;
                  &lt;p&gt;&lt;asp:Label ID="lblSelection" runat="server" /&gt;&lt;/p&gt;
  &lt;asp:Button ID="btupdate" runat="server" Text="Update" /&gt;
  </code></pre>
  
  <p>this is the VB code(converted)  it's not what i want but i think i can deal with it </p>
  
  <pre><code>        Imports System.Data
  Imports System.Configuration
  Imports System.Web
  Imports System.Web.Security
  Imports System.Web.UI
  Imports System.Web.UI.WebControls
  Imports System.Web.UI.WebControls.WebParts
  Imports System.Web.UI.HtmlControls
  Public Partial Class _Default 
  Inherits System.Web.UI.Page 
  Protected Sub Page_Load(sender As Object, e As EventArgs)
    If MultiSelectGridView1.SelectedDataKeys.Count &gt; 0 Then 
    lblSelection.Text = "You selected employees: "   
  For Each k As DataKey In MultiSelectGridView1.SelectedDataKeys    
  lblSelection.Text += k.Value.ToString() &amp; ", "   
  Next
     lblSelection.Text = lblSelection.Text.TrimEnd(","C, " "C)  
  Else
     lblSelection.Text = "No employees selected"  
  End If 
  End Sub
  End Class
  </code></pre>
  
  <p>and I want to change the accepted status in my database by clicking the buttom</p>
  
  <p>any help please</p>