【发布时间】:2016-10-28 14:43:36
【问题描述】:
我有一个查询,我想将十进制字段转换为字符串,但查询返回上述错误
LINQ to Entities does not recognize the method 'System.String ToString () "and it can not be translated into term store.
我的查询:
var t = (from f in db.teacher_fee
where f.fee_status == 1
select new
{
f.fee_date,
f.teacher_fee_id,
debit = "",
credit = f.total_amount.ToString()
});
有人可以帮我吗 谢谢
【问题讨论】:
-
这不是我的情况!
-
您可以在这里找到问题的答案:stackoverflow.com/a/8192329/1694711
-
试试
credit = SqlFunctions.StringConvert(f.total_amount)命名空间是System.Data.Objects.SqlClient -
@ElHamza - 很抱歉,但它是......
ToString用于迭代项目的值的select- 就像你的情况一样
标签: c# asp.net sql-server asp.net-mvc linq