1 string sAgo = "SELECT DISTINCT Kind,cname,( select to_number(Substr(kind,2,length(kind)-1)) from BatchCLIENT2KIND where kind <> 'all' and kind = k.kind) serno"; 2 string sIn = ",(SELECT Remain_Person FROM RemoteTakeQuota WHERE DEP_CODE IS NULL AND OverDate={0} AND Kind=k.Kind) {1}"; 3 string sAfter = " FROM BatchCLIENT2KIND k WHERE k.IS_RESERVE<>'1' AND KIND<>'all' AND KIND<>'a1' ORDER BY serno "; 4 protected void Page_Load(object sender, EventArgs e) 5 { 6 sSql_Kind = sAgo; 7 sSql_Kind += string.Format(sIn, "1", "Monday"); 8 sSql_Kind += string.Format(sIn, "2", "Tuesday"); 9 sSql_Kind += string.Format(sIn, "3", "Wednesday"); 10 sSql_Kind += string.Format(sIn, "4", "Thursday"); 11 sSql_Kind += string.Format(sIn, "5", "Friday"); 12 sSql_Kind += string.Format(sIn, "6", "WeekdSaturdayays"); 13 sSql_Kind += string.Format(sIn, "0", "Sunday"); 14 sSql_Kind += sAfter;
如果把上面的SQL改为LINQ,那Page_Load下面这些怎么处理
mark
?
把SQL输出下,唯一要处理的就是 把SQL 转成 LINQ,有什么问题?
就是不知道要怎么把这些SQL转成LINQ呀
@许大虾: linq的语法挺好学的,一点一点的分析吧,应该不是什么大问题,就是费点时间,to_number这个函数如果麻烦写的很多,可以单独提出去做一个函数。只要能写出一个比较复杂的linq,以后在遇到就不怕了!!
已自己解决