获取mssql的xml返回结构的方法

数据库在时回加for xml auto

调用方法

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

一定要生成xmldoc对象 否则系统提示错误!呵呵 这个该死的错误 困惑了我好久

xsl文件

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

以上就是获取mssql的xml返回结构的方法的内容,更多相关内容请关注PHP中文网(www.php.cn)!