LINQ к SQL и Псевдониму Столбца с пробелами

вернуть val.name! = ""? val.name: "N / A";

9
задан Joel Coehoorn 7 December 2011 в 19:37
поделиться

3 ответа

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.

3
ответ дан 4 December 2019 в 23:07
поделиться

As far as I know, you can't do this because columns alias must be valid C# identifiers, and they don't allow whitespaces.

0
ответ дан 4 December 2019 в 23:07
поделиться

You can't, sorry. Hell, if you bring a table with a space in the name into Linq it will automatically replace the space with underscores.

Besides it not being possible, it is an extremely overwhelmingly bad idea. Something that people that wrote Access should be shot because of.

-1
ответ дан 4 December 2019 в 23:07
поделиться
Другие вопросы по тегам:

Похожие вопросы: