Home  >  Article  >  Backend Development  >  Method to obtain the xml return structure of mssql

Method to obtain the xml return structure of mssql

黄舟
黄舟Original
2017-03-02 17:09:271624browse

When the database is added for xml auto

Calling method

   SqlCommand SqlComm= new SqlCommand("Psp_ShowMarkerPRoduct",Db.SqlConn);
   XmlReader Xr= SqlComm.ExecuteXmlReader();
   XmlDocument xmlDoc=new XmlDocument();
   xmlDoc.Load(Xr);
   Xml1.Document=xmlDoc;
   SqlComm.Dispose();

Be sure to generate an xmldoc object, otherwise the system will prompt an error! Haha This damn error has confused me for a long time

xsl file

<?xml version="1.0" encoding="GB2312" ?>
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  ...
 </xsl:template>
</xsl:stylesheet>

The above is the content of the method of obtaining the xml return structure of mssql. For more related content, please pay attention to the PHP Chinese website ( www.php.cn)!


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn