如何将此 sql 语句转换为 linq 或 lambda 表达式
SELECT Month,Year FROM Tbl_OrderDetails Order by cast(Year as int) ,cast(Month as int)
这里月份和年份是VARCHAR
类型
谢谢大家,
如何将此 sql 语句转换为 linq 或 lambda 表达式
SELECT Month,Year FROM Tbl_OrderDetails Order by cast(Year as int) ,cast(Month as int)
这里月份和年份是VARCHAR
类型
谢谢大家,
尝试这个
var skata = from ordtls in Tbl_OrderDetails
orderby (int)ordtls.Month, (int)ordtls.Year
select new {ordtls.Month,ordtls.Year}
或者
var skata = from ordtls in Tbl_OrderDetails
orderby Convert.ToInt32(ordtls.Month), Convert.ToInt32(ordtls.Year)
select new {ordtls.Month,ordtls.Year}