在MVC 4应用程序中保存数据SQL Server数据库时遇到问题 [英] Getting problem in saving data SQL server database in MVC 4 application

查看:82
本文介绍了在MVC 4应用程序中保存数据SQL Server数据库时遇到问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



i使用数据库第一种方法在MVC 4中创建了一个应用程序。

当我通过应用程序插入记录时它不会保存在sql server database 2008 R2中,在PayrollProjectContext(PayrollProject)中保存记录。每件事情都很好。但该做什么,以便记录存储在数据库中。

谢谢



我尝试过:



不知道该做什么,因为我创建了文章和asp.net网站中定义的内容。

可能我必须做出改变在web.config中,但不知道请帮助。


i created a application in MVC 4 using database first approach.
when i insert a record through application it will not saved in sql server database 2008 R2,instaed it saving record in PayrollProjectContext (PayrollProject).every thing is created fine. but what to do so that record will store in database.
thanks

What I have tried:

no idea what to do more since i am created what defined in articles and asp.net site.
May be i have to make change in web.config,but what don't know please help.

推荐答案

没有代码,我们只能猜测。您是否尝试过调试代码?你收到错误了吗?



如果您是ASP.NET MVC的新手,那么这一系列文章可能对您有所帮助:ASP.NET MVC 5:构建您的第一个Web应用程序 - 第1部分 [ ^ ]



该系列是在MVC 5中,但我很确定这个概念是一样的。它还使用EF与数据库方法,并针对初学者。
Without codes, we can only guess. Also have you tried debugging your code? Are you getting error?

If you are new to ASP.NET MVC, then perhaps this series of article will help you: ASP.NET MVC 5: Building Your First Web Application - Part 1[^]

That series is in MVC 5, but I'm pretty sure the concept is the same. It also use a EF with database approach and is targeted for beginners.


这篇关于在MVC 4应用程序中保存数据SQL Server数据库时遇到问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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