Home
Username:
Password:
Introduction to Microsoft Visual Studio 2008 Tutorials

Working with Databases / What is LINQ?




Visitors to VTC.com will be able to view all introductory videos for each training course.
Free Trial Members will gain access to first three chapters for each training course.
Full Access Members have full access to VTC.com’s entire library of video tutorials.


Learn More

Subtitles of the Movie

Now before we leave the topic of Databases I want to do a real quick little video here and introduce you to the concept of Link Ð L-I-N-Q. Now, this stands for Language Integrated Query. OK, now this is a deep subject and I'm just going to barely scratch the surface and introduce it to you, but you need to understand this is part of the .NET Framework 3.5 that was released back in November of 2007. So, it's integral to the .NET Framework. This is a Microsoft deal and the idea for this is that it's going to allow any data source to be queried because we've got a new challenge now. As we continue to get to these disconnected web service, service-oriented architecture type environments we need to pull data from various sources and we need to query that. Well, some of it might be an XML, some of it might be in SQL Server, whatever. Wouldn't it be cool if we could kind of map all these objects together and write one query that'll get data from all those sources? Now, that can happen, however, it requires that all of our data be encapsulated as objects. Now think back to our Class as Objects type stuff that we talked about, Object Oriented Programming, that's exactly what we're talking about here. Now, here's the bad news. OK, now you know what LINQ is, roughly. You've got a reading assignment. You're going to have to stick your head into this big time, and start to play with it, and there are some great books out there. But what I want you to take from this video is, is that LINQ is now built into the .NET Framework and there are some tools build into Visual Studio 2008, and I want to real quickly show you one of those, OK? So what I'm going to do is jump out to Visual Studio now and here we are in Visual Studio, and notice I have created just a blank Windows Application. I called it WindowsApplication21, OK? I opened this up and now what I'm going to do is right-click on my application and say: Add New Item and notice there is a LINQ to SQL Classes Item that I can add, and I'll just leave it DataClasses1, and I'm going to add this thing in here and I'm going to do just enough here to confuse you, but I just want you to see one of the tools that they have in here that you can now use in the 3.5 environment. First of all, I'm going to go into my Server Explorer, go into one of my Data Connections, and I will grab the AuthorsTable, drag it into the Tool, and so there's the representation of that, and then notice I can create Methods for this Object. I'm actually converting this Table into an Object, if you will, and then I can go grab a Stored Procedure and drag it over here and make it a Method, OK? Now, this is as far as I'm going to take it, but I want you to see these tools. Now here's the big thing I want you to see. If I click Show All Objects, and then I go to the Data Classes Designer VB code I want you to see what it has started writing for you, OK? And it's telling you this code's generated by a tool, changes may cause incorrect behavior, blah, blah, blah, but notice it has imported Framework Classes, Namespaces such as Data.Linq, Data.Linq Mapping, System.Linq, System.Linq Expressions, and now let's go look at some of the code that it has started writing for us, OK? A lot of stuff going on out here. OK, when you first look at LINQ you're going to think, ah, I think they lost me somewhere, OK? But, again, get your little book, notice we're at about 337 lines of code they've written for you. Get your book and start to step through this. This is going to invade your world at some point as xml continues to grow and spread throughout the world and throughout all our applications, it's going to come to you, OK? So I just wanted you to know what LINQ is, I wanted to just kind of show you a very brief introduction of some of the tools in here and just let you know that LINQ is now fundamentally part of the .NET Framework and there are some tools for you in Visual Studio 2008, OK? So, now, once again stop wasting that time every night, midnight to 4, go read and study about LINQ.

Tutorial Information

Course: Introduction to Microsoft Visual Studio 2008
Author: Mark Long
SKU: 34008
ISBN: 1-935320-54-8
Release Date: 2009-06-26
Duration: 7 hrs / 72 lessons
Captions: Available on CD and Online University
Compatibility: Vista/XP/2000, OS X, Linux
QuickTime 7, Flash 8

VTC Sign up & Benefits

  • Unlimited Access
  • 98,729 Video Tutorials (23,265 free)
  • Video Available as Flash or QuickTime
  • Over 1026 Courses
  • $30 for One Month Access
  • Multi-User Discounts Available