I'm learning ASP and I get stuck to update the database using asp SqlDataSource and GridView. I have the following controls:
<asp:SqlDataSource ID="SqlDataSource1"
runat="server"
ConnectionString="<%$ ConnectionStrings:BPersonalConnectionString %>"
OldValuesParameterFormatString="original_{0}"
ConflictDetection="CompareAllValues"
SelectCommand="SELECT [Marca], [Nume], [Prenume], [Salariu], [Profesia] FROM [Salariati]"
UpdateCommand="update [Salariati] set [Marca] = Marca, [Nume] = Nume, [Prenume] = Prenume, [Salariu] = Salariu, [Profesia] = Profesia
where [Marca] = @original_Marca">
<UpdateParameters>
<asp:Parameter Name="Marca" Type="Int16"/>
<asp:Parameter Name="Nume" Type="String" Size="20"/>
<asp:Parameter Name="Prenume" Type="String" Size="20" />
<asp:Parameter Name="Salariu" Type="Int32" />
<asp:Parameter Name="Profesia" Type="String" Size="10" />
<asp:Parameter Name="original_Marca" Type="Int16" />
</UpdateParameters>
</asp:SqlDataSource>
<asp:GridView ID="GridView"
runat="server"
DataSourceID="SqlDataSource1"
AutoGenerateColumns="true"
AutoGenerateEditButton="true"
DataKeyNames="Marca"
AllowPaging="true"
PageSize="3"></asp:GridView>
Whenever I try to edit and update a item I dont get any result. The grid shows me exact same values as before the update. I did not wrote any code in code behind file. I looked to some other examples already done on this subject but I was unable to identify the cause of the update problem. Any hints? Thanks!!!