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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XMLTextWriter Help

Status
Not open for further replies.

dashen

Programmer
Jul 14, 2005
233
US
I am having issues generating an XML file using the XMLTextWriter. I need to add attributes to a tag:

<response index="#">

but I can't seem to get it to work with a number that changes with a loop counter.

Code:
textWriter.WriteStartElement("response")
textWriter.WriteString("")
textWriter.WriteEndElement()

I tried to use .WriteAttributeString and also .WriteStartAttribute, but I keep on getting errors. Any help would be appreciated.

Thanks.
 
I looked up the Microsoft Library reference.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top