Hi!
I have a problem. I cannot update the row in GridView control.
<asp:Label ID="Label1" runat="server" Text="Username: "></asp:Label><asp:TextBox
ID="unTextBox" runat="server"></asp:TextBox><%--<asp:RequiredFieldValidator ID="usernameRequiredFieldValidator"
runat="server" ErrorMessage="*" ControlToValidate="unTextBox"></asp:RequiredFieldValidator>--%><asp:Button ID="unSearchButton" runat="server"
Text="Search"/><br /><br />
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" DataSourceID="MySqlDataSource" CellPadding="4" ForeColor="#333333" Font-Size="Small">
<Columns>
<asp:CommandField ShowEditButton="True" />
<asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" ReadOnly="true" />
<asp:BoundField DataField="Last_Name" HeaderText="Last Name" SortExpression="Last_Name" ReadOnly="true" />
<asp:BoundField DataField="Username" HeaderText="Username" SortExpression="Username" ReadOnly="true" />
<asp:BoundField DataField="Email" HeaderText="E-mail" SortExpression="Email" ReadOnly="true" />
<asp:CheckBoxField DataField="IsApproved" HeaderText="User Approved?" SortExpression="IsApproved" />
</Columns>
<RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<EditRowStyle BackColor="#999999" />
<AlternatingRowStyle BackColor="White" ForeColor="#284775" />
</asp:GridView>
<asp:SqlDataSource ID="MySqlDataSource" runat="server" ConnectionString="server=servername;user id=userid;Password=password;database=dbname;persist security info=True" ProviderName="MySql.Data.MySqlClient" SelectCommand="SELECT p.Name, p.Last_Name, u.Username, u.Email, u.IsApproved FROM users u INNER JOIN person p ON u.PERSON_REF = p.ID WHERE u.IsApproved=0" UpdateCommand="UPDATE users SET IsApproved=?IsApproved WHERE Username=?Username " >
<%--<SelectParameters><asp:ControlParameter ControlID="unTextBox" Name="Username" PropertyName="Text" /></SelectParameters>--%>
<UpdateParameters><asp:Parameter Type="Int16" Name="IsApproved"/><asp:Parameter Type="String" Name="Username" /></UpdateParameters></asp:SqlDataSource>
When I try edit and check the checkbox in User Approved field and then click the Update it doesn't not update the field. What am I doing wrong?