select ROW_NUMBER() over (order by (select 1)) as ID,name,salary from testAjax order by ID for xml Raw('RowNumber'),Type,Elements,Root('Details')
this xml read using asp.net c#:
using System.Xml;
using System.IO;
using System.IO;
Response.Write("<?xml version='1.0' encoding='ISO-8859-1'?>");
try
{
XmlReader xmlread = cmd.ExecuteXmlReader();
// Response.Write("<?xml version='1.0' encoding='ISO-8859-1'?>");
if (xmlread.Read())
{
XmlDataDocument xmldoc = new XmlDataDocument();
xmldoc.Load(xmlread);
xmlread.Close();
strText = xmldoc.OuterXml;
Response.Write(strText);
}
else
{
Response.Write(strText);
}
}
catch
{
Response.Write(strText);
}
try
{
XmlReader xmlread = cmd.ExecuteXmlReader();
// Response.Write("<?xml version='1.0' encoding='ISO-8859-1'?>");
if (xmlread.Read())
{
XmlDataDocument xmldoc = new XmlDataDocument();
xmldoc.Load(xmlread);
xmlread.Close();
strText = xmldoc.OuterXml;
Response.Write(strText);
}
else
{
Response.Write(strText);
}
}
catch
{
Response.Write(strText);
}
Comments
Post a Comment