Brian Roisentul
Brian Roisentul

Reputation: 4740

How to programmatically get a Discussion Board's reply from a webpart for SharePoint 2010

I'm building a visual webpart for SharePoint 2010 and I need to get a reply from a Discussion Board programmatically (asp.net).

Because I get the folder Discussion 1 (inside a Discussion Board, let's say) and then I want to browse its files but I get files.count = 0, while I perfectly get the Document Library's files using that code.

Any ideas?

Upvotes: 1

Views: 2380

Answers (1)

Rich Bennema
Rich Bennema

Reputation: 10335

Try:

SPQuery query = new SPQuery();
query.Folder = folder;
SPListItemCollection items = list.GetItems(query);

See also:

Upvotes: 2

Related Questions