I am trying to insert a new item into a sharepoint list and keep getting the following error:
"Exception of type Microsoft.Sharepoint.SoapServer.SoapServerException was thrown".
This is the code that I'm using:
listService.Credentials = System.Net.CredentialCache.DefaultCredentials
Try
xmlNdList = listService.GetList("Client List"
Catch 'list hasn't been created yet
xmlNdList = listService.AddList("Client List", "Use this list to add client information", 100)
End Try
Dim strBatch As String
strBatch = "<Method ID='1' Cmd='New'>" + _
"<Field Name='ID'>4</Field><Field Name='Field_Number'>999</Field></Method>" + _
"<Method ID='2' Cmd='Update'><Field Name='ID' >6</Field>" + _
"<Field Name='Field_DateTime'>2003-11-11T09:15:30Z</Field></Method>"
Dim xmlDoc As New Xml.XmlDocument
Dim elBatch As Xml.XmlElement = xmlDoc.CreateElement("Batch"
elBatch.InnerXml = strBatch
Try
Dim ox As System.Xml.XmlNode = listService.UpdateListItems("Client List", elBatch)
Catch ex As Exception
End Try
The list 'Client List' is published on the Sharepoint, but I can not insert items into it. Can anyone please tell me what I am doing wrong.
Thank you
Lena
"Exception of type Microsoft.Sharepoint.SoapServer.SoapServerException was thrown".
This is the code that I'm using:
listService.Credentials = System.Net.CredentialCache.DefaultCredentials
Try
xmlNdList = listService.GetList("Client List"
Catch 'list hasn't been created yet
xmlNdList = listService.AddList("Client List", "Use this list to add client information", 100)
End Try
Dim strBatch As String
strBatch = "<Method ID='1' Cmd='New'>" + _
"<Field Name='ID'>4</Field><Field Name='Field_Number'>999</Field></Method>" + _
"<Method ID='2' Cmd='Update'><Field Name='ID' >6</Field>" + _
"<Field Name='Field_DateTime'>2003-11-11T09:15:30Z</Field></Method>"
Dim xmlDoc As New Xml.XmlDocument
Dim elBatch As Xml.XmlElement = xmlDoc.CreateElement("Batch"
elBatch.InnerXml = strBatch
Try
Dim ox As System.Xml.XmlNode = listService.UpdateListItems("Client List", elBatch)
Catch ex As Exception
End Try
The list 'Client List' is published on the Sharepoint, but I can not insert items into it. Can anyone please tell me what I am doing wrong.
Thank you
Lena