Which code segment should you include in the helper method?

You have a helper method named CreateSiteColumn that contains the following code segment.
static void CreateSiteColumn ( SPWeb web, string columnName ) {} You need to add a new site
column of type Choice to a SharePoint site by using the helper method. Which code segment
should you include in the helper method?

You have a helper method named CreateSiteColumn that contains the following code segment.
static void CreateSiteColumn ( SPWeb web, string columnName ) {} You need to add a new site
column of type Choice to a SharePoint site by using the helper method. Which code segment
should you include in the helper method?

A.
SPField field = new SPFieldChoice(System.web.Lists[0].Fields, columnName);

B.
web.Fields.Add(columnName, SPFieldType.Choice, true);

C.
web.Lists[0].Fields.Add(columnName, SPFieldType.Choice, True);

D.
web.Lists[0].Views[0].ViewFields.Add(columnName);



Leave a Reply 0

Your email address will not be published. Required fields are marked *