且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何用资源中的字符串替换select查询中的值?

更新时间:2022-11-11 18:53:11

足够简单。将ResourceManager.GetString调用的值分配给LINQ表达式之外的字符串变量,然后只使用该变量代替所有ResourceManager.GetString调用。



您收到该消息的原因是因为底层数据库引擎不知道ResourceManager是什么或如何将对它的任何调用转换为SQL代码。
Easy enough. Assign the value of the ResourceManager.GetString call to a string variable outside of the LINQ expression, then just use the variable in place of all of your ResourceManager.GetString calls.

The reason you get that message is because the underlying database engine doesn't have a clue what a ResourceManager is or how to translate any call to it into SQL code.