locked
linq query and alias RRS feed

  • Question

  • User632428103 posted

    Hi all,

    i'm a beginner with linq, i work with asp net 4.0

    i would like to know if it's possible to create an alias on a column with a space inside ?

    sample => alias => student ID

    here is it my query for example :

    var datas = from x in context.students where x.actif == true

                       select new { studentID = x.id, ................ };

    but i want this (student ID)

    var datas = from x in context.students where x.actif == true

                       select new { student ID = x.id, ................ };

    student ID with a space, i've try with " student ID " but that doesn't work ..

    any suggestion ?

    thanks for your time

    Thursday, July 16, 2015 8:12 AM

Answers

  • User1577371250 posted

    Hi,

    No You can't create a variable/column name with space.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, July 16, 2015 8:29 AM

All replies

  • User1577371250 posted

    Hi,

    No You can't create a variable/column name with space.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, July 16, 2015 8:29 AM
  • User632428103 posted

    hi lokesh b r,

    thanks for your time ..

    i've try to find another solution

    Thursday, July 16, 2015 9:00 AM