使用MS Enterprise Library返回int(count(*)) [英] Return int (count(*)) using MS Enterprise Library

查看:95
本文介绍了使用MS Enterprise Library返回int(count(*))的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用MS Enterprise Library和存储的proc从Sql Server数据库返回计数(int).我已经搜索过,只能找到如何返回数据读取器和数据集.

I am trying to return a count (int) from a Sql Server database using MS Enterprise Library and a stored proc. I have searched and can only find how to return datareaders and datasets. Can someone please show me the way?

推荐答案

您将使用ExecuteScalar方法从存储的proc返回单个值,例如count(*).
You would use the ExecuteScalar method to return a single value, such as count(*) from a stored proc.

blockquote>


这篇关于使用MS Enterprise Library返回int(count(*))的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆