In LINQ, I’d like to project different names than those from the database tables. ‘Friendly names’ that I can use for column headers. Names that have ‘%’ or possibly a ‘ ‘ (space). The query below won’t compile.
Is something like that possible or am I stuck using the dreaded _ underscore for everything?
dim query = from p in ctx.SomeTable() _ select ProductName = p.product_name, _ [Expiration Date] = p.expiration_date, [% of sales] = p.pct_sales
It’s certainly possible to project different names for the fields of the database by using the select clause.
However the names that are chosen still must be valid VB identifiers. So that will preclude you from using a space or %