Things We Love About Visual Basic Dot NetThings we love about VisualBasicDotNet:
(...sometimes related to ThingsWeLoveAboutVbClassic.)
Not to be confused with ThingsWeHateAboutVisualBasicDotNet.
List:
Discussion:
Dim xmlVar As XElement = _
<rootElement>
<innerElement1/>
<innerElement2>Constant text here.</innerElement2>
</rootElement>
and you can embed expressions to dynamically change element and attribute names and values
Dim xmlVar As XElement = _
<rootElement>
<nameElement type=<%= greetingType %>><%= "Hello " + nameVar + "." %></nameElement>
<<%= dynamicElementName %> <%= dynamicAttributeName %>="static attribute value"/>
</rootElement>
and VisualBasic automatically does all the appropriate quoting, giving one a high level of protection against SqlInjection attacks.
In VisualBasicDotNet, one might do a DLinq query like this:
SELECT p2.ProductName?, p1.UnitPrice?
FROM dbo.ProductsCostingMoreThan?(80.50)
AS p1 INNER JOIN Products AS p2 ON p1.ProductID = p2.ProductID
Where in the CsharpLanguage (C#), it would look more like this:
var q =
from p in db.ProductsCostingMoreThan?(80.50m)
join s in db.Products on p.ProductID equals s.ProductID
select new {p.ProductID, s.UnitPrice?};
The VB.NET syntax is much more like the RelationalDatabase's SQL syntax than the C# version.
The C# version has all the same clauses, but they're in some other order that's "more natural" for a collections library.
Related: LanguageIntegratedQueryProject
EditText of this page
(last edited November 4, 2012)
or FindPage with title or text search