Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding and Item in a list and updating it

Status
Not open for further replies.

AT76

Technical User
Apr 14, 2005
460
US
Hello,

Can someone suggest a way of finding an item in a list and updating that item to a different value.

I have tried using UpdateListItems but have not been successful.

Example: ListName is LIST
Column is credit
I want to find testCredit in Column credit and change its value.

Here's my code:
Code:
			XmlDocument xmlDoc = new System.Xml.XmlDocument();
			System.Xml.XmlElement batchElement = xmlDoc.CreateElement("Batch");

			batchElement.SetAttribute("OnError", "Continue");

batchElement.InnerXml = "<Method ID='1' Cmd='Update'>" +
				"<Field Name ='ID'>credit</Field>" +
				"<Field Name ='testCredit'>NEWVALUE</Field></Method>";

l.UpdateListItems("LIST", batchElement);

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top