如何使用EntityFramework对MVC3中sqserver2008中的表执行插入,更新,删除操作 [英] How to perform Insert,Update,Delete operations on a table present in sqserver2008 in MVC3 using EntityFramework

查看:91
本文介绍了如何使用EntityFramework对MVC3中sqserver2008中的表执行插入,更新,删除操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hii to all,

在过去的2周内我开始学习MVC,在这方面我想从FrontEnd(即使用MVC3)执行简单的插入,更新,删除操作到表中SqlServer2008,我在谷歌搜索但我没有找到确切的文章,我在数据库中创建了一个名为employee的表,其中包含以下列EmpId,EName,Designation,DeptNo.Using MVC3如何执行所有Insert,在员工表上更新,删除操作,请为我提供使用EntityFramework连接数据库的步骤,并为所有DML操作编写一些LINQ,当我谷歌搜索执行此DML操作时,我找到了DataContext类,请告诉我是什么是这个datacontext类,其中&我们如何添加这个类。谢谢提前



谢谢

Ramu

Hii to all,
For the past 2weeks i started learning MVC,in this regard i want to perform simple Insert,Update,Delete operations from FrontEnd(i.e using MVC3)to a table present in SqlServer2008,i have searched in google but i didn''t find the exact article,i have created a table called employee in a database which has the following columns EmpId,EName,Designation,DeptNo.Using MVC3 how can i perform all Insert,Update,Delete operations on employee table,please provide me with the steps for connecting to the database using EntityFramework and by writing some LINQ for all DML operations,when i was googling about performing this DML operations iam finding the DataContext class,please tell me what is this datacontext class where&how we can add this class.Thanks in advance

Thanks
Ramu

推荐答案

此视频将帮助您开始使用ASP.NET MVC3中的Entityframework

http://pluralsight.com/training / Player?author = scott-allen& name = mvc4-building-m4-data-i& mode = live& clip = 0& course = mvc4-building [ ^ ]



希望这有帮助
This Video will help you to started with Entityframework in ASP.NET MVC3
http://pluralsight.com/training/Player?author=scott-allen&name=mvc4-building-m4-data-i&mode=live&clip=0&course=mvc4-building[^]

Hope this helps


这篇关于如何使用EntityFramework对MVC3中sqserver2008中的表执行插入,更新,删除操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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