Posted By

qrist0ph on 04/30/08


Tagged

xml


Versions (?)

Who likes this?

5 people have marked this snippet as a favorite

enajenkins
umang_nine
paelgr
khouser
Priestd09


C# XML Processing


 / Published in: C#
 

  1. static void Csharp_HelloWorld_XML()
  2. {
  3. XmlDocument doc = new XmlDocument();
  4. XmlNode myRoot;
  5. XmlAttribute myAttribute;
  6.  
  7.  
  8. myRoot = doc.CreateElement("HelloXMLWorld");
  9. myRoot.InnerText = "ROOT Element";
  10. doc.AppendChild(myRoot);
  11. myAttribute = doc.CreateAttribute("Attribute1");
  12. myAttribute.InnerText = "AttributeText1";
  13. myRoot.Attributes.Append(myAttribute);
  14. //doc.Save(@"c:\helloxmlworld.xml");
  15. Console.WriteLine(doc.OuterXml);
  16.  
  17. XmlNode connSntringNode = root.SelectNodes(@"//ConnectionString")[0];
  18. }

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: ankit_champaneriya on June 12, 2008

this code is very help ful to me thankyou

Posted By: ankit_champaneriya on June 12, 2008

error:Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

In sql server 2005 sp executing in 45 sec.

reference add: Microsoft.ApplicationBlocks.Data.dll code behind: i have use sqlhelper class

SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & “GetCostSummaryByDate”, PickupFromDate, PickupToDate, CompanyNo, SystemNo, AccountNo, Reference, sort)

i have not use sqlcommand

pls reply me solution as soon as possible..

Regards, ANKIT CHAMPANERIYA

You need to login to post a comment.