0
 Dim placesOfServces =  From x In tbl_pos _
                        Where x.active = True _
                        Select  x.pos_id, x.pos_code & " - " & x.pos_desc

出现错误

范围变量名称只能从不带参数的简单名称或限定名称中推断出来。

问题,需要返回一个串联的x.pos_codeand字符串x.pos_desc。帮助必须在 VB.NET 中。

4

2 回答 2

2
Dim placesOfServces =  From x In tbl_pos _
                        Where x.active = True _
                        Select New With {.Pos_id= x.pos_id , .CodeDesc = x.pos_code & " - " & x.pos_desc}
于 2013-05-07T18:53:07.643 回答
1

试试这样:

 Dim placesOfServces =  From x In tbl_pos _                                       
                       Where x.active = True _
                       Let cc = x.pos_code & " - " & x.pos_desc   
                       Select  x.pos_id, cc
于 2013-05-07T18:49:34.833 回答