Google Search

Google
 

Sunday, May 25, 2008

Video: How Do I: Upgrade Visual Basic Projects to Enable LINQ?

Presenter:Beth Massi


Visual Basic programmers will learn about the new multi-targeting feature and how to upgrade projects written in Visual Basic 2005 to Visual Basic 2008 Beta 2 in order to enable different LINQ providers.

Click here to go to original video page


Minute 0

High in my name is Beth Massey and today I m going to show you how to convert applications written in Visual Studio 2005 and the net framework 2 0 Visual Studio 2008 will walk through the new multi targeting feature and how to upgrade your project to the net 3 5 framework and how to enable link based on what providers you want to use if you re familiar with link I encourage you to watch D how do I series on link which you can find on the Visual Basic developer Center sought in Visual Studio 2005 open to Windows form project I created that connected the Northwind database and displays categories and products to let what I do is upgrade its product projects so that I can start using the new net framework 3 5 and enable link specifically link over data sets since my current application is based on data sets I d like to start writing queries over them this doesn t effect my architecture of my application and all it just
Minute 1

Osman to work with his data much easier on my forms directly to it and close Visual Studio 2005 and I m going to open a solution in Visual Studio 2008 and the first thing it does is it opens the Visual Studio conversion wizard which is quite helpful and click next and will create a backup is always a good idea of her project before we upgrade and then click finish what this will do is upgrade the solution file the SLN file the project file in this case the DPP RJ file is still actually compatible with Visual Studio 2005 Sonata to do is I m to go ahead and double click on my project and this will open up the project properties to do is go to the compile tab in the first thing were going to do in order to enable link isn t going to set our option and refer to on option in the third tells the compiler to inferred
Minute 2

Apes of local variables and makes it much easier to write link queries through the Senate keep this on the next thing within a deal is were going to click the advanced compile options button now you ll see down here at the bottom to target framework and you ll notice that it still sets the net framework two ow this multi targeting feature allows us to develop code for all three of these different frameworks using the same Visual Studio IDE so instead of having to load multiple versions of Visual Studio to target the framework you can do the coding all inside of Visual Studio 2008 for each of these different frameworks so but to order to enable links were going to select net framework 3 5 in things like okay okay
Minute 3

The references section and you ll notice is not you can see that system core DLL in version 3 5 0 0 is now being referenced for us and that s because the upgraded to target framework however in order to start writing link queries will need to import a couple namespace is an out of couple more references depending on which providers that want to use soap to enable pure link to objects on the references to adhere just under import namespace is we need to import system link from a scroll down here and just select system link so this ll go ahead and allow us to write a link queries over objects so if we go ahead into some code matches open up our formal click and will go to the code behind I can start to ahead and right dim my files
Minute 4

Instants deposed from files and my computer filesystem get files in the current directory for instance select files pay the word aloud now to start writing link queries and you notice that this on option for goes ahead in it infers from the right hand side of my expression here what the Titans going to be a basically and I innumerable of string can collection of strings okay so that s how we enable pure linked over objects you notice I m just basically write a query over to get files but in order to write queries that work over data sets will need to do a couple of things first let s go back to de references tab and what we need to do is we need to add a reference to system data data set extension
Minute 5

Someone in the heading click add under references and will go to go ahead and find system data data set extensions right here next to need to me run the data set generator on data sets we want to write link queries are still just right click and go ahead and save run the custom tool select this does is it beat generates the data set code so that data tables now inherit from a link ready class called tight table base this is a knee system data data set extension namespace sin now will be able to write queries that work over our tight data sets so if I go back to the form we can now write queries like this
Minute 6

And LCD IntelliSense on your category row was a queer category names and say like CE to recount in case it now and we cover over this will see that it is inferred it as the numeral will row collection of categories throughout and this is exactly what we wanted so remember you have two first added the system data data set extensions reference and then you have to be generate the data set code by right clicking and selecting run custom tool and this is because you need to inherit from a link ready class called tight table base okay so that s the trick said now what if we want to enable other type of link providers Sprint
Minute 7

NCAA say we want to write queries over XML so we want to enable linked XML source go back to the Project properties references tab select act emerging at system XML link case that once we had that reference were also going to go ahead and add the imports system XML link and now will be able to write queries over XML last provider that we may want to use is if he linked SQL provider and that s pretty easy all you can do to enable that instead of manually having to do it we can just go ahead and add new item and we can go ahead and select link to SQL classes and this will automatically add the proper references and imported meat spaces for us simply go back to our project properties you ll see that it on
Minute 8

Bickley added system data length when we did that send our ready to go start writing queries over our data sets over XML over any object in the net framework and also use link to SQL so I d like to thank you for your time if you d like to check out the Visual Basic developer Center will be posting updates these videos there please also check out the Visual Basic team blog and my blog for more information basic

No comments: