Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. LINQ
  4. alias problem

alias problem

Scheduled Pinned Locked Moved LINQ
helpcssdatabase
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Nilish
    wrote on last edited by
    #1

    hi, i was using the following query to bing it with the data grid.

    dim baseclass as baseclassdatacontext = nothing
    baseclass=new baseclassdatacontext

    dim query = from p in baseclass.gettable(of table1)() _
    select p

    now the problem is , if i want to use aliases i write in following way

    dim query = from p in baseclass.gettable(of table1)() _
    select name = p.name

    if i have to use the alias by seperating the word like

    dim query = from p in baseclass.gettable(of table1)() _
    select first name = p.name

    then i am getting error due to alias , please help , i want a column name of two words

    H K 2 Replies Last reply
    0
    • N Nilish

      hi, i was using the following query to bing it with the data grid.

      dim baseclass as baseclassdatacontext = nothing
      baseclass=new baseclassdatacontext

      dim query = from p in baseclass.gettable(of table1)() _
      select p

      now the problem is , if i want to use aliases i write in following way

      dim query = from p in baseclass.gettable(of table1)() _
      select name = p.name

      if i have to use the alias by seperating the word like

      dim query = from p in baseclass.gettable(of table1)() _
      select first name = p.name

      then i am getting error due to alias , please help , i want a column name of two words

      H Offline
      H Offline
      Howard Richards
      wrote on last edited by
      #2

      Youy can't do it: the .NET CLR does not support variable names containing spaces

      'Howard

      1 Reply Last reply
      0
      • N Nilish

        hi, i was using the following query to bing it with the data grid.

        dim baseclass as baseclassdatacontext = nothing
        baseclass=new baseclassdatacontext

        dim query = from p in baseclass.gettable(of table1)() _
        select p

        now the problem is , if i want to use aliases i write in following way

        dim query = from p in baseclass.gettable(of table1)() _
        select name = p.name

        if i have to use the alias by seperating the word like

        dim query = from p in baseclass.gettable(of table1)() _
        select first name = p.name

        then i am getting error due to alias , please help , i want a column name of two words

        K Offline
        K Offline
        K V Sekhar
        wrote on last edited by
        #3

        Linq will not support spaces in variable names. You can use _(underscore) instead of space. dim query = from p in baseclass.gettable(of table1)() _ select first_name = p.name Cheers, sekhar

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups