asp.net存储过程的调用怎么写
大家好 我是新手 对存储过程不太了解,在帮助下我写了个存储过程 返回的是一张很多条件后查询结果的表 我想把这张表的三个字段绑定到gridview中的三个列里 语句如何写 希望大家能帮我~~~急~~~
ALTER PROCEDURE [dbo].[GetOne]
@sno nvarchar(10)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
declare @total int
declare @real int
select @total=count(*) from TaskDate a where exists
(select distinct TGuidancePlace from Report b where a.TGuidancePlace=b.TGuidancePlace and b.sNumber=@sno)
select @real=count(*) from Report where sNumber=@sno
select @total as '应交',@total-@real as '未交',@real as '实交'
END
------解决方案--------------------http://www.enet.com.cn/article/2007/0111/A20070111387720.shtml
------解决方案--------------------http://www.cnblogs.com/wxfblog/archive/2010/06/01/1749009.html
------解决方案--------------------Database db = DatabaseFactory.CreateDatabase();
DbCommand dbCommand = db.GetStoredProcCommand("存储过程名");