none
Linq Concat two Columns Value in Visual Studio RRS feed

  • Question

  • I have a query and I need to concatenate two column values . but it has Error (below picture)

    help please

     Dim query = From b In db.BimSpec
                        Join j In db.TabJob
                        On b.JobNo Equals j.CodeJ
                        Where b.JobNo = j.CodeJ And b.userid = userid
                        Order By b.id Descending
                        Select New With {b.id, b.BimNo,b.FName +" "+b.LName , b.NatCode, b.ShNo, j.DescJ}

    Tuesday, September 15, 2015 3:55 AM

Answers

  • And,

    Please refer code below,

    Dim query = From b In db.BimSpec
                        Join j In db.TabJob
                        On b.JobNo Equals j.CodeJ
                        Where b.JobNo = j.CodeJ And b.userid = userid
                        Order By b.id Descending
                        Select New With {Key .id = b.id, .BimNo = b.BimNo, .Name = b.FName + " " + b.LName, .NatCode = b.NatCode, .ShNo = b.ShNo, .DescJ = j.DescJ}

    • Marked as answer by Ashkan209 Tuesday, September 15, 2015 4:40 AM
    Tuesday, September 15, 2015 4:35 AM

All replies

  • Hi, 

    Please refer link below.

    https://msdn.microsoft.com/en-us/library/bb918115.aspx

    or 

    https://msdn.microsoft.com/en-us/library/bb384767.aspx?f=255&MSPPError=-2147217396

    Wish can help you.

    Thanks


    • Edited by stef chui Tuesday, September 15, 2015 4:33 AM Add one more link
    Tuesday, September 15, 2015 4:28 AM
  • And,

    Please refer code below,

    Dim query = From b In db.BimSpec
                        Join j In db.TabJob
                        On b.JobNo Equals j.CodeJ
                        Where b.JobNo = j.CodeJ And b.userid = userid
                        Order By b.id Descending
                        Select New With {Key .id = b.id, .BimNo = b.BimNo, .Name = b.FName + " " + b.LName, .NatCode = b.NatCode, .ShNo = b.ShNo, .DescJ = j.DescJ}

    • Marked as answer by Ashkan209 Tuesday, September 15, 2015 4:40 AM
    Tuesday, September 15, 2015 4:35 AM