I have another post which resulted in this
SELECT DISTINCT
a.ArticleID,
COUNT(*) AS KeywordMatch,
a.Headline,
a.ShortDescription,
a.CategoryID,
a.ArticleSectionImage,
a.DatePublished
FROM
Article a
JOIN SearchWords sw ON a.ArticleID = sw.ArticleID
WHERE
EXISTS
(
SELECT
1
FROM
iter_charlist_to_tbl(@temp, ) s
WHERE
s.nstr = sw.SearchWord
)
AND
a.ArticleState = 3
GROUP BY
a.ArticleID, a.Headline, a.ShortDescription, a.CategoryID, a.ArticleSectionImage, a.DatePublished
ORDER BY (KeywordMatch) DESC, (a.DatePublished) DESC
I am using this along with Linq-to-SQL to create paging for the users. The problem is, that i need to know how many records my search returned (total rows), to display the correct arrows for the user.
This is my Linq-to-SQL Query:
int iPageNum = pageNumber;
int iPageSize = (int)pageSize;
results = data.SearchArticles(searchString).Skip((iPageNum - 1) * iPageSize).Take(iPageSize).ToList();
Any ideas?
Is my Linq-to-SQL pulling all records from the database? or does it create a query that only selects the records that i needs? How can i peak at the query?