I'm creating an SPList item programatically. Everything goes fine, I add a list, I add spfields to it.
SPList list = (SPList)oWeb.Lists[listName]; SPField libraryNameField = new SPField(list.Fields, "Library", Names.LIBRARY_NAME); libraryNameField.Type = SPFieldType.Text; libraryNameField.Required = true; list.Fields.Add(libraryNameField);
But I encounter a problem. The fields are created, but not viewed on default view. What am I missing? How can I achieve that programatically?