SQL2008 using LINQ for data access

Source: Internet
Author: User

Directory

LINQ projects: Unified language characteristics for objects and relational queries 1

Experiment Goal 1

Practice LINQ2 for in-memory collections

Task Overview Create "LINQ" solution 2

Task 2– query for a list of integer types 2

Task 3– query structured Type 4

Practice 2–linq to SQL: LINQ6 for connection-oriented databases

Task, create an object map – Create an object and provide property 6

Task 2– Create object Mapping – Use Designer – add designer file 8

Task 3– Create object Mapping – Use designer – Create object View 8

Task 4– Query using an expression 9

Task 5– modify data in the database 10

Task 6– Call stored Procedure 12

Task 7– extended Query Expression 13

Practice 3– understand standard query operators [choose to do]14

Task 15 query using the standard query operator

Task 2– using the Select operator 16

Task 3– using the where operator 18

Task 4– using the Count operator 18

Task 5– use min, Max, Sum, and average operators 19

Task 6– using the all and any operators 20

Task 7– using ToArray and tolist operator 21

Experiment Summary 23

LINQ projects: Unified language characteristics for objects and relational queries

This experiment will introduce the LINQ project. - oriented. NET's Language Integration query Framework ("LINQ") is a language extension of C # and VB, and is a unified programming model that extends the. NET Framework to provide object-oriented, database, and XML integrated queries.

In this experiment, you'll see how to use the LINQ attribute to access collections in memory, XML documents, and connected databases. The end of the experiment is an optional exercise that takes you through the different standard query operators for data processing and extraction.

Experimental target

Complete this experiment estimated need: 90 minutes

The goal of this experiment is to give you a clearer understanding of LINQ projects. You'll see how data is processed for objects in memory and relational databases. The new LINQ API benefits from IntelliSense and enables full compile-time checking without regard for string based queries.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.