0

I want to insert new item in SharePoint list using web part . It is possible with using c# or web services.

closed as too broad by Robert Lindgren Sep 13 '16 at 7:32

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

1

You can add new item to SharePoint List using one of this

  • Server Side Object model via C#
  • REST Endpoint.
  • Client Side Object Model.
  • Web Services and JQuery.
  • JSOM

Via Server Side Object model via C#

  • Create a sharePoint Solution via Visual Studio.
  • Add New Item > Add Visual Web Part.
  • Add Labels and Textbox that you need to added it to your list.

Add the following code

void Addnewitem()
{

SPWeb mySite = SPContext.Current.Web;
SPListItemCollection listItems = mySite.Lists[TextBox1.Text].Items;

SPListItem item = listItems.Add();

item["Title"] = TextBox2.Text;
item["Stock"] = Convert.ToInt32(TextBox3.Text);
item["Return Date"] = Convert.ToDateTime(TextBox4.Text);
item["Employee"] = TextBox5.Text;

item.Update();
}

For more details check How to: Add or Delete List Items

Via REST.

If you need to use Rest interface check Working with lists and list items with REST

Via Client Side Object Model

If you need to use Client Side Object Model (.Net Managed) , you should check How to: Create, Update, and Delete List Items via CSOM

Via Web Services

If you need to use Web Services and JQuery , Check also CRUD On List Items Using Web Services And jQuery In SharePoint 2013

Via JSOM

If you need to use JSOM check CRUD Operation On List Items Using JSOM In SharePoint 2013

Not the answer you're looking for? Browse other questions tagged or ask your own question.