Alias names in LINQ

Finally figured out how to set alias names in LINQ, and it’s easy.

Dim orgs = From p In db.Departments Select p.deporg, Name = p.deporg & " - " & p.depname Order By deporg

Name being the name of the concatenated field of p.deporg and p.depname.

This entry was posted in SQL, VB.NET, Visual Basic and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">