Which code segment should you include in the helper method?

You have a helper method named CreateSiteColumn that contains the following code segment.
Private Shared Sub CreateSiteColumn (ByVal web As SPWeb, ByVal columnName As String)
web.Lists(0).Views(0).ViewFields.Add(columnName) End Sub 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.
Private Shared Sub CreateSiteColumn (ByVal web As SPWeb, ByVal columnName As String)
web.Lists(0).Views(0).ViewFields.Add(columnName) End Sub 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.
Dim field As SPField = New SPFieldChoice (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 *