locked
Upadate a gridView why I have to have id as textBox RRS feed

  • Question

  • User-909867351 posted

    HI

    When I edit one gridview the id field becomes a textbox. I don't want this, I want it becomes one Label to avoid people to edit the id. But no luck If I choose the template do label and Bind it to id I can't update the record, no error but no update. How can I solve this?

    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" SelectCommand="select * from disciplinas order by descricao" UpdateCommand="update disciplinas set descricao=?, p_unit=?,iva=?,valor_total=? where id=?">
             <UpdateParameters>
                                    <asp:Parameter Name="descricao" Type="String" />
                                    <asp:Parameter Name="p_unit" Type="Double" />
                                    <asp:Parameter Name="iva" Type="Int16" />
                                    <asp:Parameter Name="valor_total" Type="Double" />                               
                                    <asp:Parameter Name="id" Type="Int16" />
                                </UpdateParameters>
                </asp:SqlDataSource>

    Saturday, September 8, 2018 4:15 PM

Answers