MS SQL2005 Query/Stored Proc Results To Text 使用 SqlCommand 或任何其他方法 [英] MS SQL2005 Query/Stored Proc Results To Text using SqlCommand or any other method
问题描述
我有一个简单的问题.
我需要以简单文本的形式返回结果,无论是字符串还是类似的.
I need to return results as simple text, either as a string or similar.
即我想要相同的行为,例如
i.e. I want the same behavior such as
结果到文本 (Cntrl + T)
Results to Text (Cntrl + T)
当您从 SQL Server Management Studio 运行查询时.
When you run a Query from SQL Server Management Studio.
对于从 C# 调用存储过程,如何以编程方式完成此操作?
How can this be done programmatically against calling a Stored Proc from C#?
即类似于 ExecuteReader();
或 ExecuteXMLReader();
但返回一个字符串.
i.e. similar to ExecuteReader();
or ExecuteXMLReader();
but returning a string instead.
是否有一些 ToString()
可用?
谢谢,凯.
推荐答案
不,您必须通过从 dbreader 中读取数据来自行构建.
No, you will have to build the sting yourself by reading from dbreader.
这篇关于MS SQL2005 Query/Stored Proc Results To Text 使用 SqlCommand 或任何其他方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!