I am using sharpdevelop to write a program which would add items to a pre-existing list on a SharePoint website .
This is my code :
using System.IO;
using Microsoft.SharePoint;
using System;
namespace Sampl22.cs
{
class Program
{
public static void Main(string[] args)
{
using (SPSite site = new SPSite("http://community.intranet/Lists/AllItems.aspx"))
{
using (SPWeb web = site.OpenWeb())
{
SPList list = web.Lists["Sample Forms Data"];
SPListItem item = list.Items.Add();
item["FormName"] = "New Form";
item["Data"] = "Description of Task";
item.Update();
}
}
}
}
}
and the errors that i am getting are :
The type or namespace name 'SPSite' could not be found (are you missing a using directive or an assembly reference?) (CS0246)
The type or namespace name 'SPList' could not be found (are you missing a using directive or an assembly reference?) (CS0246)
The type or namespace name 'SPListItem' could not be found (are you missing a using directive or an assembly reference?) (CS0246)
The type or namespace name 'SPWeb' could not be found (are you missing a using directive or an assembly reference?) (CS0246)
Under the references section I have:
- FPSRVUTL
- FPWEC
- Microsoft.SharePoint.BusinessData.Administration.Client
- Microsoft.SharePoint.BusinessData.Administration.Client.Intl
- System
- System.Core
- System.Data
- System.Data.DataSetExtensions
- System.Xml
- System.Xml.Linq
What should be done in order to remove these errors ?