text: A group blog from members of the VB team
  Yesterday I promised to post about the hidden gems in Visual Basic and Visual Studio 2008 that you haven’t read about in blog posts or seen at conferences. I forgot that I mentioned a few of my favorite features in the Beta1 announcement where I showed off the improvements in the Intellisense experience – statement completion for keywords, local variables, and expressions. In that post, I also cover a new language feature called Relaxed Delegates which allows you to provide alternate signatures for events. Both of those are pretty great features – but I promised to tell you about some new stuff.
  I polled the team and we came up with the following top ten that weren’t mentioned in my previous post. There’s so much I could talk about – but you’re going to have to check back. But first, I have to start with a keynote feature…
  In short, multi-targetting allows you to use Visual Studio 2008 (and VB 9!) to target the .NET 2.0 frameworks. All of the following features I’ll show you can be leveraged even if you’re targeting .NET 2.0! (With the exception of items #5 & #7 as they depend on the LINQ to Objects and LINQ to XML APIs which reside in .NET 3.5) To do this, when you start up Visual Studio and create a new project, just make sure that the target framework is set to .NET Framework 2.0.
  Note that projects you’re upgrading, will automatically target .NET Framework 2.0 until you add references to .NET 3.0 or 3.5 assemblies.
  In Visual Basic 9, in the following bit of code and NOTHING is late-bound – everything is bound at compile-time which means you get Intellisense and type checking.
  Dim dialog = New OpenFileDialog()
  Dim result = dialog.ShowDialog()
  Dim printStr = "C:\"
  If result = Windows.Forms.DialogResult.OK Then
  printStr = dialog.FileName
  End If
  MsgBox(printStr)
  This makes prototyping very quick, easy, and type-safe! This feature and the mechanisms that control it are comprehensively covered in this article by a member of our QA team, Bill Horst.:
  I'm a fan of any feature that improves readability.
  Generally, in the .NET frameworks, we try to design APIs that use the create-set-call pattern as our usability studies have indicated they are the easiest to use by the average programmer. Nevertheless, objects that don’t have a parameterless constructor exist in the .NET framework. When that happens, it’s really nice to be able to leverage Object Initializers which are kind of like a Dim and a With statement combined into an expression. That makes parameterized constructors somewhat easier to tolerate:
  Dim strm As New StreamWriter( _
  New FileStream("C:\out.txt", FileMode.OpenOrCreate) _
  With {.Position = 10})
  It also makes creating arrays of objects much easier.
  Dim Capitals() As City = {New City With {.Name = "Antanarivo", .Country = "Madagascar"}, _
  New City With {.Name = "Belmopan", .Country = "Belize"}, _
  New City With {.Name = "Monaco", .Country = "Monaco"}, _
  New City With {.Country = "Palau", .Name = "Koror"}}
  I love this feature because it means never having to say you’re sorry… No, really, it means that you don’t need to migrate to a new data access technology to reap the benefits of LINQ. I fill my DataSet just as before, and then I can query against the DataSet:
  Me.EmployeesTableAdapter.Fill(Me.NORTHWNDDataSet.Employees)
  Dim query = From emp In Me.NORTHWNDDataSet.Employees _
  Where emp.Country = "USA" _
  Order By emp.HireDate _
  Select emp
  Me.EmployeesBindingSource.DataSource = query
  How cool is this?
  How about this?
  What do you think of this?
  We’ve blogged about XML Intellisense before. But there’s a tidbit we’ve overlooked.
  When namespaces are used in the XML document you’re reading from, the Intellisense engine matches the namespace prefix and the local name. This little productivity boost can yield a significant savings in keystrokes. Instead of typing the prefix then the colon and then the local name, you just type a little bit of the local name and hit enter. Here is a small example of how it works, starting with an input document and the applicable intellisense:
  If we just type the letter “t” the “tomato” entry will be selected:
  If we type the letter “e” the “exa:eggplant” will be selected and the completion list will also contain the prefix “exa” and the “elephant” entry:
  The next character that will be typed will determine which single entry will get selected. Now, how easy was that?
  Often, when you define a variable, you want to view the type definition in code or in the Object Browser. There’s a new option in the context menu which allows you to go directly to the type definition instead of just the variable declaration. This is great when combined with type inference as it allows you confirm that the type of the variable is actually what you believe it to be.
  And this code:
  Without having to specify the type of the control variable, it’s inferred from right-hand-side expression or the collection we’re iterating over.
  The background compiler is an awesome feature that gives you immediate feedback on the correctness of the code you write. We’ve made some tremendous strides in the performance of the background compiler in this release. We believe that the background compiler is 3 times faster uses 3 times less memory. Anyone who has migrated their project to 2008 should notice an improvement after a couple minutes of use.
  While we’ve made huge improvements on the throughput, certain operations like changing the declaration of a base class that’s used many times in a large project is computationally expensive. If you attempted to invoke a feature that relied on compiled information before the background compiler has a chance to do its magic, like Intellisense or the Drop Downs, previous versions of Visual Studio would grind to a halt until the compilation was complete. Those operations are no-longer blocking. So, while you might occasionally get the drop downs to look like this:
  The IDE will still be responsive.
  Now do you have to download it? Remember, you can always grab the Express Edition!
  PingBack from
  Will the Express version Offline Install only be made available as the all-in-one DVD ISO as currently published?
  Or can a VB 2008 Express CD ISO be expected later?
  Time for another weekly round-up of developer news that focuses on .NET, agile and general development
  Just say WOW. I plaied with some of these feature in beta 2 I really love it. Thank you
  Go To Type Definition in VS 2008
  i dont have such a window like shown at Multi-targetting.
  I need to change the requirements down to framework 2.0 because i dont want to add components from framework 3.5.
  how to make this in vb-express 08
  Amanda Silver from The Visual Basic Team recently blogged about Hidden Gems in Visual Basic 2008 . Call
  Can I link to SQL 2000 using LINQ, or do we have to wait until we get upgraded to SQL 2005 ?
  Has anybody managed to link to a DB2 database with LINQ ?
  The new IF operator has short circuit logic. The IIF function does not. The IIF function should be obsoleted.
  Here is the latest in my link-listing series .  Also check out my ASP.NET Tips, Tricks and Tutorials
  What a great post. I just love that you started the list at zero. You are awesome!
  For those who make fun of Visual Basic, Amanda Silver may have something to show off to you. Over at
  【原文地址】 December 8th Links: ASP.NET, ASP.NET AJAX, ASP.NET MVC, .NET, VS 2008 【原文发表日期】 Saturday, December