語言整合查詢,包含4個元件
linq to sql :查詢資料庫的資料
linq to dataset :查詢dataset中的資料,對其增刪等操作
linq to xml :查詢xml檔案
linq to objects :查詢集合資料,如陣列或list
1.int array = ; //from int a in array a的型別可以省略
ienumerable tt = from a in array //用var 代替 ienumerable where a % 2 == 0 //ling解析的返回值是容器,儲存著所有找到的元素
orderby a descending //降序 預設為生序ascending
select a; //select new
foreach (int item in tt)
2.var result = from c in ayya //result 儲存的分組
group c by c.class; //按班級分組
foreach (var c in result)
//遍歷分組的元素
}3.int a=; int b=;
var result = from x in a //從多個陣列中選擇元素
from y in b
let s = x+y //判斷求和
where s ==10
select new
foreach(var v in result)
public static string bookstr = "" +
"" +
"《水滸傳》" +
"" + …;
int main()
}}
C 基礎第十五天
1 file操作檔案 path操作路徑 filestream操作流 streamreader streamwriter directory操作資料夾 目錄 createdirectory delete move exist 判斷是否存在 getfiles 獲得指定目錄下所有檔案的全路徑 getdir...
LinuxC 第十五天
靜態庫 靜態庫 要被包含到源程式中的庫 優點 執行速度快 缺點 占用系統資源比較多 使用的場合 對時間要求很高的場合 靜態庫的製作 1 把所有的源程式 c檔案 製作成目標檔案 o 檔案 gcc c mul.c o mul.o gcc c sub.c o sub.o gcc c add.c o add...
Qt第十五天
qwdialogsize.h ifndef qwdialogsize h define qwdialogsize h include namespace ui class qwdialogsize public qdialog endif qwdialogsize hqwdialogsize.cpp...