Search code examples
linq-to-sql

LINQ to SQL and Column Alias with spaces


Still a bit new to Linq. This is driving me nuts. I want to alias a column, the alias should have a space.

This works fine:

Dim q = From tmp in t.Table Select iDate = tmp.iDate

But, I want this to work

Dim q = From tmp in t.Table Select "Some Alias With Space" = tmp.iDate

Any ideas?


Solution

  • First of all Alias's can't have spaces, just like any variable name can't have a space. My question tho is why would you want/need to have a space in your name? I'm sure there are better means of accomplishing what your trying to achieve with out trying to institute bad practices of bad naming conventions.