c# - Converting an XML file to string type -


how can write xml file string variable? here code have,the variable content supposed return xml string:

    public string getvalues2()     {         string content = "";         xmltextwriter textwriter = new xmltextwriter(content, null);         textwriter.writestartelement("student");         textwriter.writestartelement("r", "record", "urn:record");         textwriter.writestartelement("name", "");         textwriter.writestring("student");         textwriter.writeendelement();         textwriter.close();          return contents;      } 

something this

string xmlstring =  system.io.file.readalltext(filename); 

here answer create xmldocument xdocument or xmldocument


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -