Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Yes, it is. You can use <code>?</code> operator in F#, and it will perform the same way in dynamic typing in C# and VB.NET in .NET 4.0. For a start, you can read this sample Dynamic SQLDataReader from Tomas Petricek's blog:</p> <p><a href="http://tomasp.net/blog/dynamic-sql.aspx">http://tomasp.net/blog/dynamic-sql.aspx</a></p> <p>Here's a quote from his article:</p> <blockquote> <p>In this article, we'll look how to use the dynamic operator to make the experience of using ADO.NET from F# dramatically better. Dynamic operator (there are actually two of them) are a simple way of supporting dynamic invoke in F#. We can use it to write code that looks almost like an ordinary method call or property access, but is resolved dynamically at runtime (using the name of the method or property). The following example shows what we'll be able to write at the end of this article:</p> <pre><code>// Call 'GetProducts' procedure with 'CategoryID' set to 1 use conn = new DynamicSqlConnection(connectionString) use cmd = conn?GetProducts cmd?CategoryID &lt;- 1 conn.Open() // Read all products and print their names use reader = cmd.ExecuteReader() while reader.Read() do printfn "Product: %s" reader?ProductName </code></pre> <p>If you ever tried to call a SQL stored procedure directly using the SqlCommand, then you can surely appreciate the elegance of this code snippet. Let's now take a look at a larger example and some of the neat tricks that make this possible...</p> </blockquote> <p>And for more info, you can read the rest of his article. Happy dynamic coding in F# :)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload