SHOW CONTENTTYPES

SHOW CONTENTTYPES displays information about all content types of a given list.

This command always return same columns. For the complete listing see the SHOW CONTENTTYPES reference.

Syntax

SHOW CONTENTTYPES FROM list_name;

Example: to show content types of list Employees:

SHOW CONTENTTYPES FROM Employees

Code example: Get all content types of a list and print name and description.

Print list content types

using (var connection = new SharePointConnection(connectionString))
{
    connection.Open();
    using (var command = new SharePointCommand("SHOW CONTENTTYPES FROM Tasks", connection))
    {
        using (var reader = command.ExecuteReader())
        {
            while (reader.Read())
            {
                Console.WriteLine(reader["Name"].ToString().PadRight(20) + " : " + reader["Description"].ToString());
            }
        }
    }
}

Code result

Task                 : Track a work item that you or your team needs to complete.
Folder               : Create a new folder.
Summary Task         : Group and describe related tasks that you or your team needs to complete.


Skip Navigation Links.

Visa     MasterCard