如何讓LINQ查詢的結果輸出table裡所有的欄位資料
今天假如我有一個 Table employee
在Table 裡有 ID , name, phone  三個欄位
若我想查詢所有名字出現"Andy"的員工時
使用一般的SQL查詢的語法如下:
Select *
from employee
where name like 'Andy' 
那如果是用LINQ來查詢呢!?
答案:
| 
var profile = ( from p in employee 
                       where p.name.Contains( "Andy") 
                       select p ) 
                      . toList(); | 
留言
張貼留言