Hello I'm using Tridion 2011 and I need to get all the components from a specific publication and based on a specific schema in C#. Does anyone knows how to do it? Thanks in advance.
Not sure why you want to do that and where you want to do that (in TBB or Custom application or just want to review/make a list of those items for something). Apart from above answer which seems absolutely fit for the purpose if you want to do that in a custom application for some custom business logic. There are another way you can do thats:
- Use Advanced Search in CME - and select the publication, type of item and based on Schema to get a list of items:
- Further, you can choose to save this filter/query as a Virtual Folder - which you can access similar to a Folder listing all items based on your query. Also, you can code to read the content of this Virtual Folder using Core Service (in custom applications) or using TOM.NET API (in TBBs or Event System)