Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Not able to add list items?

  Asked By: Luz    Date: Feb 11    Category: Sharepoint    Views: 1188

I am having trouble writing to a list item. Its throughs no
exceptions but the list item does not ge inserted. anyone see
anything wrong with my code:

SPWeb web = new SPSite("http://moss01.com/cards").OpenWeb();

SPList myList = web.Lists["Security Log"];
SPListItem myNewItem = myList.Items.Add();
myNewItem["Title"] = "test";
myNewItem["User Name"] = "test"; // user;
myNewItem["Action"] = "test"; //action;
myNewItem["Hostname"] = "test"; //hostname;
myNewItem["IP Address"] = "test"; //IP;



No Answers Found. Be the First, To Post Answer.

Didn't find what you were looking for? Find more on Not able to add list items? Or get search suggestion and latest updates.