In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains "Linq combination query how to integrate database language query", interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Next let the editor to take you to learn "Linq combination query how to integrate database language query" bar!
Generally speaking, Linq composite queries provide a very general way to add some multi-purpose syntax query features to .net Framework that can be applied to all information sources.
Experimental Camp 1: Linq combination query: integrated database language query
This lab camp will give you a clear picture of Linq project support for relational data access with the help of Linq composite queries. You will first create an object model based on the Northwind database, and then query the Northwind database using the new VB.NET query expression.
We will use the Linq to Sql designer to create an object model from an existing database. Then, you will look at the entity relationships between the mapping tables and use create, update, and delete operations. Next, we will explore how to use transaction, object retrieval (retrieval) technology, stored procedure integration and the use of Linq to Sql to identify objects (identify).
Linq to Sql is a language-independent Linq composite query project component. Although all the examples in this document are shown in Visual Basic for consistency, Linq composite queries can still be used in C # compilers that support the Linq version.
Experimental camp target
The estimated time to complete this hands-on experimental camp is 60 minutes.
The goal of this lab camp is to practice and learn some tasks about the integration of Linq composite queries and VB.NET programs. We will explore "CRUD" operations-create, receive, update, and delete-and how they complete SQL queries or update commands without using external methods. You will get how entities in the program map to database tables and how to adjust the mapping process.
Exercise 1-using Code Generator to build an object Model
Exercise 2-create your first Linq composite query project
Exercise 3-create an object model
Exercise 4-modify data in the database
Exercise 5-apply more advanced features
Exercise 1-using Code Generator to build an object Model
In this exercise we will see how to simply create an object model through a visual Linq designer. The next two exercises will delve deeper into what's going on behind the scenes: but the designer has done it for you!
Step 1-create a Linq project
1. Click start | Program | Microsoft Visual Studio 2008 Beta 2 | Microsoft Visual Studio 2008 Beta 2 menu command.
two。 After opening Microsoft Visual Studio, click File | New | Project... Menu command
3. In the New Project dialog box, in Project types, click Other Languages | Visual Basic
4. In the Templates on the right side of the dialog box, select Console Application
5. Fill in "Linq To Sql VB" in the Name field to provide a name for your solution
6. Click OK
Step 2-add a reference to the System.Data.Linq assembly
1. In Microsoft Visual Studio, click Project | Add Reference... Menu command
two。 Open the Add Reference dialog box and make sure the .NET label is selected
3. Select the System.Data.Linq assembly
4. Click OK
Introduce the namespace System.Data.Linq in Module1.vb, and remember to place it before the module definition:
Imports System.Data.Linq
Step 3-create a Linq to Sql file
1. In Microsoft Visual Studio, click Project | Add New Item... Menu command
two。 Click Linq To Sql File in the Templates window on the right
3. Provide a name for the new item and enter "Northwind" in the Name field
4. Click OK
Step 4-add a new data connection
1. In Microsoft Visual Studio, click the View | Server Explorer menu command (or press Ctrl+W,L)
two。 Click the Connect to database button in the Server Explorer window
3. In the pop-up Add Connection dialog box, enter ".\ sqlexpress" in the Server name field to provide the address of the local database server
4. Use the Select or enter a database name combo box to change the database to "Northwind"
5. Click OK
At this point, I believe that everyone on the "Linq combination query how to integrate database language query" have a deeper understanding, might as well to the actual operation of it! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.