Click here to Skip to main content
15,890,512 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
This is my store procure

SQL
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



I want call ON .CS page Like this

C#
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;


But I not getting ans

How can i call my store procured help me please


[edit]SHOUTING removed, Code block added - OriginalGriff[/edit]
Posted
Updated 9-Apr-12 21:03pm
v2
Comments
OriginalGriff 10-Apr-12 3:03am    
DON'T SHOUT. Using all capitals is considered shouting on the internet, and rude (using all lower case is considered childish). Use proper capitalisation if you want to be taken seriously.

1 solution

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:
C#
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();
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900