Skip to content
Loading
  • Laxmidhar Sahoo
    0
    Hi Fisal you are currect .But bellow to convertion of xml given
     
    1. using System;  
    2. using System.Collections.Generic;  
    3. using System.Linq;  
    4. using System.Xml.Linq;  
    5. using System.xml;  
    6. namespace LINQtoXML {  
    7.    class ExampleOfXML {  
    8.       static void Main(string[] args) {  
    9.        XDocument xdoc = XDocument.Load(@"c:\\data.xml"); //you'll have to edit your path  
    10.          var lv1s = from lv1 in xdoc.Descendants("Student")  
    11.                select new(Student s) {   
    12.                    s.Name = lv1.Attribute("Name").Value,  
    13.                    s.BirthDate = lv1.Attribute("BirthDate").Value,  
    14.                };  
    15.   
    16.            
    17.   
    18.          foreach (var item in lv1s) {  
    19.             Console.WriteLine("date - " + Convert.toDateTime(item.Value));  
    20.          }  
    21.   
    22.          Console.WriteLine("\nPress any key to continue.");  
    23.          Console.ReadKey();  
    24.       }  
    25.    }  
    26. }  
     
    0
  • Mageshwaran R
    0
    Hi,
    Please refer the below link, it might helps you
    https://stackoverflow.com/questions/5677212/how-do-i-convert-datetime-net-datatype-to-w3c-xml-datetime-data-type-string-and 
    0