sharepoint list update
-
2011. február 10. 4:29
I am first time working on sharepoint, I am trying to update a sharepoint site(Field in a webpart) by using sharepoint web service from a vb .net application, my code is as follows -
Dim SuppliersList As New SharepointLists.Lists
Dim SupplierFields As XmlNode
Dim SupplierMaintenanceListName As String
'Set the Credentials to use to retrieve the update request from SharePoint
SuppliersList.Credentials = New System.Net.NetworkCredential(ShrPtUserID, ShrPtPasswrd, ShrPtDomain)
'Build the target SharePoint site URL from the Passed qsSource parameter
Dim BaseUrl As String = Mid(qsSource, 1, InStrRev(qsSource, "/"))
SuppliersList.Url = BaseUrl & "_vti_bin/Lists.asmx"
'Get the ID values for the SharePoint List
Dim SupplierMaintenanceListName As String = RetrieveSharePointListID(SuppliersList)
Sub UpdateSharePointRecord()
Try
Dim str As String = SupplierFields.InnerXml.Replace("Create", "Completed")
SupplierFields.InnerXml = str
SuppliersList.UpdateListItems(SupplierMaintenanceListName, SupplierFields)
Response.Redirect(qsSource)
Catch ex As Exception
OutputHTMLprogress("Error. Movex Web Service Code got an error :
" + ex.Message & "
")
End Try
End Sub