SP2010: How to get url to Announcements list item?

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/>
</IsNotNull></Where>";


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

w.Dispose();

Open in new window


But ... How can I get an URL of actual announcement?
LVL 1
tolppaAsked:
Who is Participating?
 
tolppaAuthor Commented:
I solved my problem. Seems like I cannot get SPListItem with SPSiteDataQuery.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.