技术开发 频道

SQL Server 2008 LINQ to Entity

【IT168 技术文档】

准备工作
预计完成本实验所需的时间
40 分钟
目标
在完成本实验后,您将可以:
• 创建数据库的实体数据模型
• 使用LINQ查询语言访问实体数据模型

先决条件
在完成本实验前,您必须具有:
• 使用C#编写ADO.NET数据访问技术的相关经验。

实验场景
A trend among database developers is to define high-level business objects, or entities, that they then map to the tables and columns stored in a database. Rather than programming against tables and columns in a database, developers use high-level entities such as ‘Customer’ or ‘Order’ to represent the underlying data. The ADO.NET Entity Framework enables developers to program against relational data in terms of such entities. Programming at this level of abstraction is highly productive and allows developers to take full advantage of entity-relationship modeling.
The object services layer of ADO.NET enables the materialization, change tracking, and persistence of data as Common Language Runtime (CLR) objects. Developers using the ADO.NET Entity Framework can program against a database by using CLR objects that are managed by ADO.NET. SQL Server 2008 introduces more efficient, optimized support that improves performance and simplifies development.
Microsoft Language Integrated Query (LINQ) enables developers to issue queries against data by using a managed programming language such as C# or Visual Basic.NET, instead of SQL statements. LINQ enables seamless, strongly typed, set-oriented queries written in .NET Framework languages to run against ADO.NET (LINQ to SQL), ADO.NET DataSets (LINQ to DataSets), the ADO.NET Entity Framework (LINQ to Entities), and to the Entity Data Service Mapping Provider. SQL Server 2008 features a new LINQ to SQL Provider that enables developers to use LINQ directly on SQL Server 2008 tables and columns.

虚拟机环境

1. 从开始菜单或桌面上启用Microsoft Virtual PC 。如果Virtual PC 控制台没有启用,请查看系统托盘,然后双击系统托盘当中的Microsoft Virtual PC 。
2. 选择Sql08 然后点击Start。
3. 在虚拟机运行起来后,可以通过点击右Alt+Del 来向虚拟机发送一个Ctrl+Alt+Del 命令。
4. 在登录窗口中,输入以下信息:
• User name: administrator
• Password: password01!
 

0
相关文章