MySQL Forums :: MySQL for Visual Studio :: Problem of selection of lines by the methods select and between


Advanced Search

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
Problem of selection of lines by the methods select and between 191 marc-antoine yonga 01/14/2017 10:06AM
Re: Problem of selection of lines by the methods select and between 129 marc-antoine yonga 01/15/2017 05:32AM
Re: Problem of selection of lines by the methods select and between 153 JOSE RAMIREZ 01/16/2017 12:22PM


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.