Visual Basic Blog

A group blog from members of the VB team

VB 2008 IDE Tips & Tricks Presentation Materials (Lisa Feigenbaum)

Last week I went on a user group tour around Southern California. I've uploaded the materials from my talk: You can find these all posted together on the following Code Gallery page.The demo requires installation of Refactor!, which is a 3rd party tool available for free on MSDN. I also pointed out a number of resources at the end of ...

How LINQ to Dataset works in VB (Jonathan Aneja)

LINQ at its core requires any data source to be queryable, which basically means it must implement IEnumerable.  (It’s actually a bit more complicated than that, for a full explanation see section 11.21.2 of the Visual Basic 9.0 Language Specification).  Now when working with LINQ to Dataset we have a problem: DataTable does ...

Using LINQ to Dataset in an .aspx page (Jonathan Aneja)

Recently I got a customer question about how to use LINQ to Dataset in an .aspx file.  The compiler was complaining that it couldn't find the AsEnumerable method that allows LINQ to work over a DataTable ("AsEnumerable is not a member of 'DataTable'").  The code he sent looks correct, so why is the compiler not picking up the ...

Converting SQL to LINQ, Part 10: Like (Bill Horst)

This post assumes you’ve read my previous Converting SQL to LINQ posts. I haven’t had much in the way of specific requests for more LINQ posts, so I’d still welcome any suggestions that people want to offer.  I did get one request about how to mimic the LIKE keyword functionality in VB LINQ. In SQL, the LIKE ...

VB XML Cookbook, Recipe 4: Get Inner XML from the Nodes Property (Doug Rothaus)

Recipe 3 showed one way to work with mixed XML content using the XML Descendant axis property and the ReplaceWith method. This is one way to do an identity transform and we’ll look at another method in a later post. There is a key capability not mentioned in Recipe 3 that you will need for fully-functioning identity transforms. That is ...

VB XML Cookbook, Recipe 3: Identity Transforms (Doug Rothaus)

An identity transform in XSLT does just what the name implies: replace the identity of an element or attribute with a new identity. Identity transforms are especially critical when dealing with XML markup that is less rigid in its structure. Consider a documentation structure for news articles. Whenever a title is referred to within an article...

VSLive San Francisco Content (Amanda Silver)

All - I'm about to go on for my LINQ Deep Dive and Tips &Tricks session at VSLive in San Francisco. I posted all demos & slides here:https://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=LaunchVB&ReleaseId=805...

LINQ to SQL (and LINQ to Entities) performance improvements (Tim Ng)

Over the last few months, the VB and Data Programmability teams were working on fixing a performance problem with LINQ to SQL (which also manifested in LINQ to Entities). The issue was that LINQ to SQL was generating sub optimal T-SQL queries when the VB LINQ queries included filters over nullable columns. For example, consider the following ...

VB XML Cookbook, Recipe 2: Descendants and Ancestors (Doug Rothaus)

This entry in the cookbook shows how you can access descendant and ancestor elements in an XML document using Visual Basic, XML Axis properties, and LINQ to XML objects.DescendantsVisual Basic provides XML Axis properties that enable you to easily refer to child nodes and attributes. As is often the case with XML, you may need to reference sub...

Keeping Track of Books Using VB (Matt Gertz)

I have a confession to make.  I’m not a database guy.  I’ve done a lot of varied coding over my career, but somehow I’ve never been directly involved in the guts of database coding.  Whenever my code needed some sort of data-caching mechanism, I’ve tended to “roll my own,” as the saying goes.&...