public static void ModifyView(SPView view, IEnumerable<string> ViewFields, string query) { // Validation view.RequireNotNull("view"); ViewFields.RequireNotNull("ViewFields"); ViewFields.RequireNotEmpty("ViewFields"); query.RequireNotNullOrEmpty("query"); view.Query = query; view.ViewFields.DeleteAll(); foreach (string fieldName in ViewFields) { view.ViewFields.Add(fieldName); } view.Update(); }