Finding Query

Sherry Collins asked on June 15, 2015 21:36

Is there anyway to find the query for a particular webpart. Some additional columns are needed and I can't find which query is being called.

thanks for the help

Correct Answer

Brenden Kehren answered on June 16, 2015 13:33

Sherry,

You'd have to dig into that web part and ultimately the underlying control that is displayed on the web part. With the blog comments I'm guessing this is coded into the actual control. The easier thing to do would be to use a query repeater and create your own query for the comments. This way you can specify the columns in your query. You'd have to research how to do this on your own, as it's been a while since I've done it.

1 votesVote for this answer Unmark Correct answer

Recent Answers


Joshua Adams answered on June 15, 2015 21:50

Which webpart? Depends on which webpart and what its pulling in. If associated with a module/page type, it may be under the queries tab for that module.

0 votesVote for this answer Mark as a Correct answer

Sherry Collins answered on June 15, 2015 21:51

The Blog Comments Viewer

0 votesVote for this answer Mark as a Correct answer

Sherry Collins answered on June 16, 2015 01:07

Joshua - Are you able to help me any further. The webpart I am trying to find the query for is the Blog Comments Viewer. Thanks.

0 votesVote for this answer Mark as a Correct answer

Jim Spillane answered on June 16, 2015 13:55

You can try turning on Settings - Debug. The Blog Comment webpart in my test Corporate site produced the following query:

(blog.comment.generalselect)
    SELECT * FROM Blog_Comment WHERE ([CommentPostDocumentID] = @CommentPostDocumentID AND ([CommentIsSpam] = @CommentIsSpam OR [CommentIsSpam] IS NULL) AND [CommentApproved] = @CommentApproved AND ([CommentIsTrackback] = @CommentIsTrackback OR [CommentIsTrackback] IS NULL))
    @CommentPostDocumentID (403)
    @CommentIsSpam (False)
    @CommentApproved (True)
    @CommentIsTrackback (False)

I would also use Brenden's suggestion to use a repeater for greater flexibility.

1 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.