简体   繁体   English

使用F#查询表达式时收到此消息:错误FS0039:未定义值或构造函数“查询”

[英]I got this msg while using F# query expression : error FS0039: Undefined value or constructor “query”

let q = <@  seq {
                for i in [1..10] do
                    yield i  
        } |> Seq.head @>

q |> query |> ignore  //error FS0039

I'am using VS2012 and F# core of "ReferenceAssemblies\\Microsoft\\FSharp\\3.0\\Runtime\\v2.0\\FSharp.Core.dll" (version 2.3.0.0) on .NET 3.5 ; 我在.NET 3.5上使用"ReferenceAssemblies\\Microsoft\\FSharp\\3.0\\Runtime\\v2.0\\FSharp.Core.dll" (2.3.0.0版)的VS2012和F#核心;

What did I miss here? 我在这里想念什么?

I might be wrong (the versioning is a bit confusing) but if you're using F# 3.0 in Visual Studio 2012, then you should be able to use the new query expression syntax instead: 我可能是错的(版本控制有些混乱),但是如果您在Visual Studio 2012中使用F#3.0,则应该可以使用新的查询表达式语法:

query { for i in 1 .. 10 do
        select i
        head }

This works both in memory and for SQL databases (as well as some type providers). 这既适用于内存,也适用于SQL数据库(以及某些类型提供程序)。 For more information, see the MSDN documentation . 有关更多信息,请参见MSDN文档 If you're using older version (or target framework), then I'd definitely recommend upgrading - the F# 3.0 queries are much more solid and easy to use. 如果您使用的是旧版本(或目标框架),那么我绝对会建议您进行升级-F#3.0查询更加扎实和易于使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 F# 错误 FS0039:未定义值或构造函数“输入” - F# error FS0039: The value or constructor 'input' is not defined F#错误FS0039:未定义类型&#39;XmlProvider&#39; - F# error FS0039: The type 'XmlProvider' is not defined 为什么会出现F#错误FS0039:未定义名称空间或模块&#39;Http&#39; - Why am I getting F# error FS0039: The namespace or module 'Http' is not defined F#错误&#39;错误FS0039:未定义名称空间或模块&#39;MySql&#39;? - F# error 'error FS0039: The namespace or module 'MySql' is not defined'? F# CsvProvider can't find member in Row error FS0039 - F# CsvProvider cant find member in Row error FS0039 为什么我在 class 未定义的参数中收到错误提示 function - 错误 FS0039:值或构造函数“函数”未定义 - Why I get error saying function in argument for a class not defined - error FS0039: The value or constructor 'function' is not defined 错误FS0039:未定义字段,构造函数或成员&#39;X&#39; - error FS0039: The field, constructor or member 'X' is not defined 为什么在错误 FS0039 The type &#39;JsonProvider&#39; is not defined 时程序仍在运行? - Why is the program still running while Error FS0039 The type 'JsonProvider' is not defined? XmlProvider FS0039中的DomainTypes未定义 - DomainTypes in XmlProvider FS0039 not defined F#从查询表达式返回值 - F# returning value from query expression
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM