Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LINQ to SQL and Column Alias with spaces

Tags:

linq-to-sql

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?

like image 900
sugarcrum Avatar asked May 12 '09 14:05

sugarcrum


1 Answers

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.

like image 181
David Yancey Avatar answered Sep 28 '22 07:09

David Yancey