如何在MVC4 ASP.NET C#中调用存储过程 [英] How To Call Stored Procedure In MVC4 ASP.NET C#

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

问题描述

亲爱的所有人,我需要帮助,我是新手使用MVC4 ASP.Net。



如何在mvc4中调用存储过程?



有什么想法吗?还是导师?请...

Dear All, please i need help, i newbie using MVC4 ASP.Net.

How to call stored procedure in mvc4 ?

any idea ? or tutor ? please...

推荐答案

这可以帮到你



如何使用实体框架调用MVC4中的存储过程 [ ^ ]



使用实体框架执行存储过程 [ ^ ]
this may help you

How to call Store Procedure in MVC4 by using Entity framework[^]

Execute Stored Procedure using Entity framework[^]


如果您正在使用实体框架下面的文章可能对你有帮助。



HTTP:// stackoverf low.com/questions/20970416/using-stored-procedure-in-entity-framework



如果你没有使用Entity Framework那么调用存储过程与ADO.Net中一样正常
If you are using Entity framework then below article might help you.

http://stackoverflow.com/questions/20970416/using-stored-procedure-in-entity-framework

If you are not using Entity Framework then calling of stored procedure is as usual as in ADO.Net


您没有在应用程序中指定使用实体框架或简单的ado.net数据库连接,

和实体框架我们有数据库优先和代码优先方法,



如果你使用简单的ado.net然后简单地你可以从命令调用存储过程

如果您使用数据库拳头方法,则在edmx中添加存储过程,如下链接:



http://www.entityframeworktutorial.net/EntityFramework4.3/execute-stored-procedure-using-dbcontext.aspx [<一个href =http://www.entityframeworktutorial.net/EntityFramework4.3/execute-stored-procedure-using-dbcontext.aspxtarget = _blanktitle =新窗口> ^ ]



http://www.binaryintellect.net/articles/30738a7c-5176-4333-aa83-98eab8548da5.aspx [ ^ ]



http://msdn.microsoft.com/en-IN/library/ms189915.aspx [ ^ ]



http://stackoverflow.com/questions/4873607/how-to-use-dbcontext-database-sqlquerytelementsql-params-with-stored-proced [ ^ ]

http://visualstudiomagazine.com/articles/2014/04/01/calling-stored-procedures-from-entity-framework.aspx [ ^ ]





如果您先使用代码,请点击以下链接:



代码优先存储程序 [ ^ ]





http://www.dotnetcurry.com/ showarticle.aspx?ID = 938 [ ^ ]







http://weblogs.asp.net/dwahlin/using-entity-framework-code-first-with-stored-procedures-that-have-output-parameters [ ^ ]



http:// msdn .microsoft.com / en-in / data / jj691402.aspx [ ^ ]



(流畅的api)

http://stackoverflow.com/questions/20901419/how-to-call-sto red-procedure-in-entity-framework-6-code-first [ ^ ]



http://www.c-sharpcorner.com/UploadFile/ff2f08/code- first-stored-procedure-entity-framework-6-0 / [ ^ ]
You are not specify you are using entity framework or simple ado.net database connectity in your application,
and in entity framework we have database first and code first methods,

If you are using simple ado.net then simplly you can call stored procedure from the command
If you are using database fist method then add stored procedure in edmx as following link:

http://www.entityframeworktutorial.net/EntityFramework4.3/execute-stored-procedure-using-dbcontext.aspx[^]

http://www.binaryintellect.net/articles/30738a7c-5176-4333-aa83-98eab8548da5.aspx[^]

http://msdn.microsoft.com/en-IN/library/ms189915.aspx[^]

http://stackoverflow.com/questions/4873607/how-to-use-dbcontext-database-sqlquerytelementsql-params-with-stored-proced[^]
http://visualstudiomagazine.com/articles/2014/04/01/calling-stored-procedures-from-entity-framework.aspx[^]


and if you are using code first then please follow below links :

Code First Stored Procedures[^]


http://www.dotnetcurry.com/showarticle.aspx?ID=938[^]



http://weblogs.asp.net/dwahlin/using-entity-framework-code-first-with-stored-procedures-that-have-output-parameters[^]

http://msdn.microsoft.com/en-in/data/jj691402.aspx[^]

(Fluent api)
http://stackoverflow.com/questions/20901419/how-to-call-stored-procedure-in-entity-framework-6-code-first[^]

http://www.c-sharpcorner.com/UploadFile/ff2f08/code-first-stored-procedure-entity-framework-6-0/[^]


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

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