MVC 3中的存储过程 [英] Stored Procedure in MVC 3

查看:112
本文介绍了MVC 3中的存储过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我是MVC新手。我试图学习如何在MVC 3中使用存储过程。

我有一个名为Login的视图,包含2个文本框,userId和Password,以及一个按钮btnLogin和SQL Server中相应的表名为tbl_login具有相同的列名。

单击该按钮,我想执行一个验证登录并重定向到相应页面的存储过程,就像我们在ASPX Web应用程序中所做的那样。如何在MVC3中做同样的事情?我去的地方,我找到了使用代码第一种方法的实体框架,并且使用这个创建了表格,但是如果我们已经有表格和过程,那么无处可提,那么如何使用它们?



请提前帮助........谢谢。

解决方案

http://nndung179.wordpress.com/2012/04/10/mvc-3-and-stored-procedure-第1部分/ [ ^ ]

http://nndung179.wordpress.com/2012/04/29/mvc-3-and-stored-procedure-part-3-final/ [ ^

Hi,

I am new to MVC. I was trying to learn on how to use Stored Procedures in MVC 3.
I have a view called Login with 2 textboxes, userId and Password,and a button btnLogin and a corresponding table in SQL Server called tbl_login with the same column names.
On the click of the button, I want to execute a stored procedure that validates the login and redirects to the appropriate page, as we used to do in ASPX web applications. How to do the same in MVC3? Everywhere I go, I found entity frameworks that use code first approach and tables are created using this, but nowhere it is mentioned that if we already have tables and procs, then how to use them?

Please help........thanks in advance.

解决方案

http://nndung179.wordpress.com/2012/04/10/mvc-3-and-stored-procedure-part-1/[^]
http://nndung179.wordpress.com/2012/04/29/mvc-3-and-stored-procedure-part-3-final/[^]


这篇关于MVC 3中的存储过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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