【发布时间】:2010-12-21 21:05:02
【问题描述】:
现在我有一个存储过程(SQL 服务器),它将从“for xml path”语句返回一个 XML。我尝试使用 ExecuteXmlReader 和 ExecuteReader 读取响应,但我一无所获。 我用谷歌搜索了一段时间,但仍然找不到如何提取返回值,或者如何检索返回值。我应该使用 ExecuteXmlReader 吗?或者是其他东西? 谢谢。
con.Open();
string result = "";
XmlReader tmp = cmd.ExecuteXmlReader();
while (tmp.Read())
{
string s = tmp.Value;
}
return result;
【问题讨论】: