Quantcast
Channel: MySQL Forums - Connector/NET and C#, Mono, .Net
Viewing all articles
Browse latest Browse all 1451

Parameter must be defined (mysql - visual c#) (no replies)

$
0
0
Hello,

I encounter an error about parameter '@Rownum' must be defined and I don't see where does the error occur ?

Could you help me ?

the code is :
_ page html :
<asp:GridView ID="GV_ListeAnnonces" runat="server" AutoGenerateColumns="false" OnRowCommand="OnRowCommand" GridLines="None">
<Columns>
<asp:BoundField DataField="@Rownum" HeaderText="Numéro" />
<asp:BoundField DataField="T_JP_Annonce_Image" HeaderText="Image" Visible="false"/>
<asp:BoundField DataField="T_JP_Annonce_DtimeCreation" HeaderText="Date" />


_ page MySQL - visual c# :
SqlDataSource1.SelectParameters.Clear();
SqlDataSource1.SelectCommand = "SELECT @Rownum, T_JP_Annonce_Image, T_JP_Annonce_DtimeCreation FROM (SELECT @Rownum:=0) bat, t_jp_annonce WHERE T_JP_Annonce_fk_Jobers_Pseudo= ?Pseudo0 HAVING (@Rownum:=@Rownum+1) BETWEEN (CONVERT(?PageIndex, SIGNED INTEGER)*CONVERT(?PageSize, SIGNED INTEGER)) AND ((CONVERT(?PageIndex, SIGNED INTEGER)+1)*CONVERT(?PageSize, SIGNED INTEGER))";
SqlDataSource1.SelectParameters.Add("?Pseudo0", Session["UserNameSession"].ToString());
SqlDataSource1.SelectParameters.Add("?PageIndex", indexPage);
SqlDataSource1.SelectParameters.Add("?PageSize", StringNbLignesPage);
GV_ListeAnnonces.DataSource = SqlDataSource1;
GV_ListeAnnonces.DataBind();
SqlDataSource1.Dispose();

Viewing all articles
Browse latest Browse all 1451

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>