Skip to content

Instantly share code, notes, and snippets.

@rexcfnghk
Last active November 14, 2018 15:32
Show Gist options
  • Save rexcfnghk/17e942d0fd6eb4d644f654eca1b4b221 to your computer and use it in GitHub Desktop.
Save rexcfnghk/17e942d0fd6eb4d644f654eca1b4b221 to your computer and use it in GitHub Desktop.
open System.Data.SqlClient
let findPlayerNames dbConnectionString =
fun () ->
use sqlConnection = new SqlConnection (dbConnectionString)
use sqlCommand = new SqlCommand ("SELECT [Name] FROM Players", sqlConnection)
use reader = sqlCommand.ExecuteReader ()
seq { while reader.HasRows do yield reader.["Name"] :?> string }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment