MySQL Forums
Forum List  »  MySQL for Visual Studio

Re: Problem of selection of lines by the methods select and between
Posted by: marc-antoine yonga
Date: January 15, 2017 05:32AM

Hello,

I find the solution myself with the help of a webdevelopper.
I change the method and the syntaxe of the query. The problem is about the calling of the parameter @Rownum.

So the old query is :

SqlDataSourceTestPro12.SelectCommand = "SET @Rownum=0;SELECT @Rownum:=@Rownum+1, idTP_Article, TP_Article_Designation, TP_Article_Famille, TP_Article_Unité, TP_Article_Toutes, TP_Article_Prix, REPLACE(TP_Article_Prix,'.',',') FROM tp_article WHERE TP_Article_Toutes= ?FamilleP AND  @RowNum BETWEEN (CONVERT(?PageIndex, SIGNED INTEGER)*CONVERT(?PageSize, SIGNED INTEGER)) AND (((CONVERT(?PageIndex, SIGNED INTEGER)+1)*CONVERT(?PageSize, SIGNED INTEGER))-1)";

           
The new query is :

SqlDataSourceTestPro12.SelectCommand = "SELECT @Rownum, idTP_Article, TP_Article_Designation, TP_Article_Famille, TP_Article_Unité, TP_Article_Toutes, TP_Article_Prix FROM (SELECT @Rownum:=0) al, tp_article WHERE TP_Article_Toutes= ?FamilleP HAVING (@Rownum:=@Rownum+1) BETWEEN ((CONVERT(?PageIndex, SIGNED INTEGER)*CONVERT(?PageSize, SIGNED INTEGER))+1) AND ((CONVERT(?PageIndex, SIGNED INTEGER)+1)*CONVERT(?PageSize, SIGNED INTEGER))";

Best regards !

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Problem of selection of lines by the methods select and between
232
January 15, 2017 05:32AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.