int[] arr = new int[100];
for (int i = 0; i < 100; i++)
{
arr[i] = i;
}
var query = from i in arr where i < 10 select i;
int ii = query.Last<int>();
Response.Write(ii.ToString() + "</br>");
foreach (var item in query)
{
Response.Write(item.ToString());
Response.Write("</br>");
}
DataTable dt = SqlDbHelp.Query("select distinct job_desc from jobs").Tables[0];
var query2 = from dsLinq in dt.AsEnumerable() where dsLinq.Field<string>("job_desc").Length > 5 select dsLinq;
// query = from dsLinq in dt.AsEnumerable() where dsLinq.Field<string>("job_desc").Length > 5 select dsLinq;
//这句话为什么会错
foreach (var item in query2)
{
Response.Write(item.Field<string>("job_desc").ToString());
Response.Write("</br>");
}
问题1,SELECT写在后面有什么特殊含义没有,为什么这么写
问题2query = from dsLinq in dt.AsEnumerable() where dsLinq.Field<string>("job_desc").Length > 5 select dsLinq;//这句话为什么会错