mi passerà il file xml in questo modo:Come leggere file XML usando System.IO.Stream con LINQ
File1.PostedFile.InputStream
//reading xml file.....
public static void readXMLOutput(Stream stream)
{
System.Xml.Linq.XDocument xml = System.Xml.Linq.XDocument.Load(stream);
var query = from p in xml.Element("ste").Element("Application")
//where (int)p.Element("Id") == 1
select Page;
foreach (var record in query)
{
Response.Write("dfe") + record.Element("dfe").Value;
}
errore:
Error 1 The best overloaded method match for 'System.Xml.Linq.XDocument.Load(string)' has some invalid arguments
cannot convert from 'System.IO.Stream' to 'string'
sì, sto usando 3.5 framework. quale dovrebbe essere l'alternativa ad esso? –
puoi mostrarmi alcune righe di esempio Stream usando xmlReader? –
@teki: modificato per fornire un metodo che è possibile utilizzare. –