Hi, i am inserting new list items in share point list using web service by using the below code.
ServiceReference.DataContext sc = new ServiceReference.DataContext(new Uri("http://servername:portnumber/_vti_bin/ListData.svc"));
sc.Credentials = new System.Net.NetworkCredential(spusername, sppassword, spdomain);
sc.AddToSampleList(new ServiceReference.SampleList
{
Title= "Hello World"
});
sc.SaveChanges();
Its working fine..
I need the ID of the new inserted row..
Is there anyway to get the ID of the newly inserted row just like in costume web part
SPList spList = spWeb.Lists["SampleList"];
SPListItem spListItem = spList.Items.Add();
spListItem["Title"] = "Hello world";
spListItem.Update();
int ID=spListItem.ID;//like this
Any help or suggestions please..
Thanks in advance...