Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
Microsoft really loves creating data framework and tools. They love it so much that they create a new framework every few years. And when they aren't building a new API, they have teams enhancing and improving existing APIs. As a result of their ongoing efforts, it can seem overwhelming when choosing a data access strategy. My goal for this movie is to explain the general layout of the data infrastructures in .NET. There are several areas in .NET of interest to the data programmer. Here's a list of the upcoming topics in this movie.
Let's start at the beginning. ADO.NET shipped in the original release of .NET and has seen steady change over the years. It works with data in many sources. This is done by creating a specialized data provider class that knows how to talk to sources like Oracle, SQL Server, Access, and ODBC. There are many useful classes in ADO.NET. There are classes that communicate with the server, like Command and Connection, and there are classes that permit storing a cached copy of the data on the client, like Dataset, DataTable, DataColumn, and more.
An extension of ADO.NET is called Typed Datasets. These are generated from a tool and are based on available data schemas. Because of the generated class structure, they are easier to use in your application code. Datasets are generated from the command line by the XSD tool. In Visual Studio, you can use the Dataset Designer to create and edit the typed datasets. Here you see a class called Categories, which is a special version of an ADO.NET data table. At the bottom of the Categories view, there are details about the CategoriesTableAdapter.
Table adapters are responsible for communicating with the data store. Here you can see that we can call the Fill, or GetData method, to retrieve data from the underlying store. Also, notice the relationships between the Categories, Products, and Suppliers data tables. In recent years Microsoft has created a new querying language that is becoming popular. It is known as LINQ, which is an acronym for Language Integrated Query. It is written directly in your C# or VB code.
Here are two examples of a LINQ query. Both are written in C# language. On the top query, we are using LINQ to Objects. The var q represents the potential query that we're going to run at some future point. As you can see from that first line, we're querying the String class, calling its GetMethods. Then we're using familiar words, like orderby and group, to further query the data. If you look at the bottom query, which is a LINQ to SQL query, you notice the similarity between LINQ to SQL and LINQ to Objects.
There are many different versions of LINQ, each one optimized for querying a special type of data. Besides the two we've seen, there's also a LINQ to XML and LINQ to Entity. Finally, there is Entity Framework. This is Microsoft's version of an object relational mapper, often called an ORM. ORMs are popular because they permit a developer to think in simple terms like a customer and products, while the ORM maps those objects to the underlying data in the database. There is more to data access. Be sure and investigate the services layer in .NET.
There you will find web services, ADO.NET data services and WCF RIA Services. While it may be a struggle to understand all the nuances of the data layer in .NET, at least you can be confident that Microsoft is constantly working on improving their data story.
Get unlimited access to all courses for just $25/month.Become a member
82 Video lessons · 97550 Viewers
61 Video lessons · 84778 Viewers
71 Video lessons · 68963 Viewers
56 Video lessons · 101410 Viewers
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.
Your file was successfully uploaded.