SP2010: How to get url to Announcements list item?

Posted on 2012-08-30
Medium Priority
Last Modified: 2012-09-04
Hello. I am creating a simple Visual WebPart that reads data from announcements list. I can read announcement list with:

SPSiteDataQuery dataQuery = new SPSiteDataQuery();
 dataQuery.Webs = "<Webs Scope=\"SiteCollection\">";
 dataQuery.Lists = "<Lists ServerTemplate=\"104\" />";

 dataQuery.ViewFields = string.Concat(
  "<FieldRef Name=\"Modified\"/>", "<FieldRef Name=\"Title\"/>", "<FieldRef Name=\"Body\"/>");
 dataQuery.Query = "<Where><IsNotNull><FieldRef Name=Title/>

SPWeb w = site.OpenWeb();
//dtable = web.GetSiteData(dataQuery);
dtable = w.GetSiteData(dataQuery);


Open in new window

But ... How can I get an URL of actual announcement?
Question by:tolppa
1 Comment

Accepted Solution

tolppa earned 0 total points
ID: 38351571
I solved my problem. Seems like I cannot get SPListItem with SPSiteDataQuery.

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Note:  There are two main ways to deploy InfoPath forms:  Server-side and directly through the SharePoint site.  Deploying a server-side InfoPath form means the form is approved by the Administrator, thus allowing greater functionality in the form. …
I thought I'd write this up for anyone who has a request to create an anonymous whistle-blower-type submission form created using SharePoint 2010 (this would probably work the same for 2013). It's not 100% fool-proof but it's as close as you can get…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses
Course of the Month13 days, 19 hours left to enroll

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question