i'm using a repeater with an hyperlink and i'm displaying some data from a table x and when the link is clicked i want to add some from the displayed data in another table y
I used a datasource for selecting information , should i use another datasource for the insert command or what to do .. Any Help will be appreciated ..
here's my code .. but it doesn't display a thing
P.S: I'm new on this ^^
<asp:Repeater
id="rptproduct"
DataSourceID="SqlDataSource1"
Runat="server">
<ItemTemplate>
<asp:label
id="labCode"
Text='<%#Eval("N_produit")%>'
Runat="server" />
<asp:HyperLink
id="lnkMenu"
Text='<%#Eval("N_produit")%>'
NavigateUrl='<%#Eval("N_produit","WebForm3.aspx?N_produit={0}")%>'
Runat="server" /><br />
</ItemTemplate>
</asp:Repeater>
<br />
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:parapharmacieConnectionString %>"
ProviderName="<%$ ConnectionStrings:parapharmacieConnectionString %>"
SelectCommand="SELECT N_produit FROM produit where N_produit=@N_produit"
InsertCommand="INSERT INTO panier_produit(N_panier, N_produit, quantite) VALUES (1,@N_produit, 1)" >
<InsertParameters>
<asp:Parameter Name="N_produit" />
</InsertParameters>
<selectParameters>
<asp:QueryStringParameter
Name="N_produit"
QueryStringField="N_produit" />
</selectParameters>
</asp:SqlDataSource>