Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/287.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/entity-framework/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Linq Over EntityFramework edmx错误表达式无效,其中_C#_Entity Framework_Linq_Iqueryable - Fatal编程技术网

C# Linq Over EntityFramework edmx错误表达式无效,其中

C# Linq Over EntityFramework edmx错误表达式无效,其中,c#,entity-framework,linq,iqueryable,C#,Entity Framework,Linq,Iqueryable,使用VS 2013和SQL Server 2012,我在一个简单的SQL CLR用户定义函数中有一个C linq查询。也就是说: string userId = from uid in GEN_Application_Attribute where uid.Attribute_name == "S1WebServices_usrId" select uid.Attribute_value; string passWord = fr

使用VS 2013和SQL Server 2012,我在一个简单的SQL CLR用户定义函数中有一个C linq查询。也就是说:

string userId = from uid in GEN_Application_Attribute
                where uid.Attribute_name == "S1WebServices_usrId"
                select uid.Attribute_value;

string passWord = from pw in GEN_Application_Attribute
                where pw.Attribute_name == "S1WebServices_pwd"
                select Attribute_value;
GEN_Application_属性是一个EF对象v.5,我认为它显示在一个EDMX中。我不断收到一个错误,无效的表达式术语“where”。我的研究表明,这是EDMX没有在实体对象上实现IQueryable的结果。人们不禁要问。为什么不呢?我没能弄明白的是,我该如何修复它?我尝试了IQueryable,对我不理解的两个sqlString数据类型进行了某种类型的转换,以及其他一些零碎的东西

这不会那么难的!Sprint今天就结束了,所以我以SQLOLE的形式重新做了这件事,但我讨厌这种方法

帮忙

编辑:


SQL CLR的其余部分调用一个web函数——显然,这个片段只获取函数的userId和密码,这是我尝试使用userId和密码的文本并得到正确结果的代码中唯一的错误。

string userId=GEN\u Application\u Attribute.Firsta=>a.Attribute\u name==S1WebServices\u usrId.Attribute\u value;工作从GEN_应用程序_属性中的uid,其中uid.Attribute_name==S1WebServices_usrId select uid.Attribute_值将返回一个IQueryable。顺便说一句,您可能已经尝试过了,但我无法告诉您,通过从模型中删除一个表并读取它,我解决了多少次EDMX问题。Antrim,是的,这是我的下一步。我从来没有发现EF这么有用。但是,我只是在这里工作。Robert,书上说应该这样做,但是当我使用LinqPad直接查询表时,它返回为一个普通字符串。当然,我在项目中尝试了这两种方法,但都无法通过无效的“where”。我还有一个问题,那就是为什么在VS错误列表显示为Shuck时,我必须深入构建输出以查看此错误?字符串userId=GEN\u Application\u Attribute.Firsta=>a.Attribute\u name==S1WebServices\u usrId.Attribute\u value;工作从GEN_应用程序_属性中的uid,其中uid.Attribute_name==S1WebServices_usrId select uid.Attribute_值将返回一个IQueryable。顺便说一句,您可能已经尝试过了,但我无法告诉您,通过从模型中删除一个表并读取它,我解决了多少次EDMX问题。Antrim,是的,这是我的下一步。我从来没有发现EF这么有用。但是,我只是在这里工作。Robert,书上说应该这样做,但是当我使用LinqPad直接查询表时,它返回为一个普通字符串。当然,我在项目中尝试了这两种方法,但都无法通过无效的“where”。我还有一个问题,那就是为什么我必须通过构建输出来查看此错误,而VS错误列表显示为Shuck?