jockesoft wrote:But you don't include BlogPostID in your query...
Change the beginning of your query to:
SelectCommand="SELECT BlogPostTitle, BlogPostID FROM...
BR
Joakim
yes i know i haven't includes BlogPost ID, that's why i posted my SQL statement here:
I have tried this:
SelectCommand="SELECT BlogPostTitle, BlogPostID FROM (SELECT DISTINCT TOP (5) COUNT(Nop_BlogComment.BlogCommentID) OVER(PARTITION BY Nop_BlogPost.BlogPostID) AS cnt, Nop_BlogPost.BlogPostTitle FROM Nop_BlogComment INNER JOIN Nop_BlogPost ON Nop_BlogComment.BlogPostID = Nop_BlogPost.BlogPostID ORDER BY cnt DESC ) Results
Then i get this error message:Server Error in '/NopCommerceStore' Application.
--------------------------------------------------------------------------------
Invalid column name 'BlogPostID'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Invalid column name 'BlogPostID'.