呼叫商店程序 [英] Calling store procudure

查看:70
本文介绍了呼叫商店程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的商店采购信息

This is my store procure

crate proc [dbo].[SP_BP_pingGenrated]
(
@ID bigint,
@MemberID bigint,
@SponsorID bigint,
@BoardID bigint,
@SerialID bigint,
@RankLevel bigint,
@PlanID varchar(50),
@createDate datetime,
@ModifiedDate datetime,
@status bit
)
AS
declare @Count int
SELECT @Count=COUNT(ID) from BP_pinGenrated
if @Count >13
BEGIN
SELECT @MemberID= MemberID from BP_pinGenrated WHERE SponsorID >1
--declare @mid int
--@mid=MemberID
--@MemberID 

update BP_pinGenrated SET SerialID=11,RankLevel=2 where MemberID=@MemberID
end




我想像这样在ON.CS页面上调用




I want call ON .CS page Like this

adp = new SqlDataAdapter("SP_BP_pingGenrated", con);
adp.SelectCommand.CommandType = CommandType.StoredProcedure;
scd = new SqlCommandBuilder(adp);
SqlCommand cmd = new SqlCommand("SP_BP_pingGenrated");
cmd.CommandType = CommandType.StoredProcedure;



但我没有得到ans

我该如何打电话给我的商店采购请帮助我


[edit]删除喊话,添加了代码块-OriginalGriff [/edit]



But I not getting ans

How can i call my store procured help me please


[edit]SHOUTING removed, Code block added - OriginalGriff[/edit]

推荐答案

您调用的代码看起来不起作用-您不会出现给出任何过程参数,或实际调用它.
尝试这样的事情:
You call code doesn''t look like it works - you don''t appear to give any of the procedure parameters, or actually call it.
Try something like this:
SqlConnection con = new SqlConnection(strConnect);
con.Open();
SqlCommand com = new SqlCommand("myStoredProcedure", con);
com.CommandType = CommandType.StoredProcedure;
SqlParameter name = new SqlParameter("@Name", SqlDbType.VarChar, 100);
name.Direction = ParameterDirection.Output;
com.Parameters.Add(name);
com.ExecuteNonQuery();


这篇关于呼叫商店程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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