---
title: "How do you connect (reference) to a SharePoint list, and how do you insert a new List Item?"  
description: "How do you connect (reference) to a SharePoint list, and how do you insert a new List Item?"  
author: "Chris Anderson"  
published: 2011-09-17  
updated: 2020-09-17  
canonical: https://www.mindstick.com/interview/1277/how-do-you-connect-reference-to-a-sharepoint-list-and-how-do-you-insert-a-new-list-item  
category: "sharepoint"  
tags: ["sharepoint"]  
reading_time: 1 minute  

---

# How do you connect (reference) to a SharePoint list, and how do you insert a new List Item?

**C#:**

using(SPSite mySite = [new](http://www.google.com/search?q=new+msdn.microsoft.com) SPSite("yourserver"))\
{\
using(SPWeb myWeb = mySite.OpenWeb())\
{\
SPList interviewList = myWeb.Lists["listtoinsert"];\
SPListItem newItem = interviewList.Items.Add();\
newItem["interview"] = "interview";newItem.Update();\
}\
}

## Answers

### Answer by Chris Anderson

**C#:**

using(SPSite mySite = [new](http://www.google.com/search?q=new+msdn.microsoft.com) SPSite("yourserver"))\
{\
using(SPWeb myWeb = mySite.OpenWeb())\
{\
SPList interviewList = myWeb.Lists["listtoinsert"];\
SPListItem newItem = interviewList.Items.Add();\
newItem["interview"] = "interview";newItem.Update();\
}\
}


---

Original Source: https://www.mindstick.com/interview/1277/how-do-you-connect-reference-to-a-sharepoint-list-and-how-do-you-insert-a-new-list-item

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
