首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

for xml auto 有关问题?如何在页面显示

2012-02-25 
for xml auto 问题?怎么在页面显示用for xml auto 子句得到如下表,但是不能在页面显示,XML codetest ID

for xml auto 问题?怎么在页面显示
用for xml auto 子句得到如下表,但是不能在页面显示,

XML code
<test ID="1" col1="1" col2="b" col3="1" /><test ID="2" col1="1" col2="c" col3="4" /><test ID="3" col1="1" col2="a" col3="9" /><test ID="4" col1="1" col2="b" col3="16" /><test ID="5" col1="1" col2="c" col3="25" /><test ID="6" col1="1" col2="a" col3="36" /><test ID="7" col1="1" col2="b" col3="49" />



用ExecuteScalar()方法截断,用什么方法在页显示xml,依然以xml格式

[解决办法]
我知道你什么意思了
不是用ExecuteScalar() 而是用ExecuteXmlReader();
C# code
System.Xml.XmlReader xr = Command.ExecuteXmlReader();            xr.Read();            while (!xr.EOF)             {                Response.Write(Server.HtmlEncode(xr.ReadOuterXml()));                         }            xr.Close(); 

热点排行