Hi,
I am using an xml file to import into the database using the below code.
Code
XmlDocument xmlDoc = new XmlDocument();Code
xmlDoc.Load(path + "Data.xml");Code
XmlNodeList nodeList = xmlDoc.DocumentElement.SelectNodes("/DocumentElement/Profile");Code
//read XML data and ID is one of the columnCode
object[] ID = XDocument.Load(path + "Data.xml").Descendants("ID").Select(element => Element.Value).ToArray();Now the ID element has null values and when I read them the rows with null values are omitted. How can I set empty string values for those null nodes?
Nishant MittalRank #692 · 3.5K reputationPosted Nov 17, 2015, 1:27 AM EST
Sourabh SomaniRank #37 · 35.5K reputationPosted Nov 17, 2015, 1:54 AM EST
Vignesh KumarRank #1,578 · 1K reputationPosted Nov 17, 2015, 2:40 AM EST
Sourabh SomaniRank #37 · 35.5K reputationPosted Nov 17, 2015, 2:43 AM EST
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts