在asp.net中被称为用户定义的过程 [英] called user defined procedure in asp.net

查看:93
本文介绍了在asp.net中被称为用户定义的过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个过程,该过程从表中获取数字并将其相加,并在sql中给出这些数字的平均值.现在我想在asp.net中调用该过程.

i have create a procedure that takes number from a table add them and gives he average of those numbers in sql. now i want to call that procedure in asp.net. can somebody tells me how to call that procedure.?

推荐答案

请检查以下文章.

http://www.c-sharpcorner.com/UploadFile/gtomar/storedprocedure12052007003126AM/storedprocedure.aspx [ ^ ]

有关更多信息,请访问
Check the below article.

http://www.c-sharpcorner.com/UploadFile/gtomar/storedprocedure12052007003126AM/storedprocedure.aspx[^]

For more info, go here[^].



您可以通过以下方式调用您的SP

Hi
you can call your SPs by using following way

 Sqlcommand cmd=new SqlCommand("exec procedurename",con);
con.open();
 object ad=cmd.executescalar();
con.close();
 string avg1=ad.tostring();



最好的



All the Best


这篇关于在asp.net中被称为用户定义的过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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