如何在C#中使用存储过程命令? [英] how can use store procedure comand in C#?

查看:60
本文介绍了如何在C#中使用存储过程命令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的命令是..

  GO  
DECLARE @ return_value int

EXEC @ return_value = [dbo]。[IssuePlanDataforCStore]

@ iPlanDate = N ' 20121102'
@ iPlanMonth = 11
@ iPlanYear = 2012
SELECT ' 返回值' = @ return_value
GO
...

解决方案

us这些代码行

 sqlCommand cmd = new sqlCommand(store_procedureName,con); 
sqlDataAdapter da = new sqlDataAdapter(cmd);
cmd.commandtype = commandtype.storeprocedure;





如果有帮助,请选择答案..


参考此链接



在ADO.NET中调用存储过程 [ ^ ]



使用ADO.NET调用select sql server存储过程 [ ^ ]



使用ADO.NET执行存储过程(C#) [ ^ ]



问候..:)

my comand is..

GO
DECLARE @return_value int

        EXEC @return_value = [dbo].[ IssuePlanDataforCStore]
   
    @iPlanDate = N '20121102',
    @iPlanMonth = 11,
    @iPlanYear = 2012
    SELECT 'Return Value' = @return_value
GO
...

解决方案

use these lines of code

    sqlCommand cmd = new sqlCommand("store_procedureName", con);
            sqlDataAdapter da = new sqlDataAdapter(cmd);
cmd.commandtype=commandtype.storeprocedure;



select as answer if it helps..


Refer this link

Calling Stored procedures in ADO.NET[^]

Calling select sql server stored procedures using ADO.NET[^]

Execute stored procedure using ADO.NET (C#)[^]

Regards..:)


这篇关于如何在C#中使用存储过程命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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