Skip to content

Instantly share code, notes, and snippets.

@rexcfnghk
Last active November 14, 2018 15:32
Show Gist options
  • Save rexcfnghk/a2c0588f7dbaa4d7704ba994753db151 to your computer and use it in GitHub Desktop.
Save rexcfnghk/a2c0588f7dbaa4d7704ba994753db151 to your computer and use it in GitHub Desktop.
open System.Data.SqlClient
let findPlayerNames dbConnectionString () =
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