Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8862617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:46:16+00:00 2026-06-14T15:46:16+00:00

I was able to get a piece of code to run in an .fsx

  • 0

I was able to get a piece of code to run in an .fsx script. I never did see it loop over the track data I’m pulling back. So I thought I would put it in an .fs file and compile it. I’m running into 2 issues. F# IDE underlines the type keyword and the let in the let query = line. Here is my oode (below) Where am I off on the syntax?

open System
open System.Data
open System.Data.Linq
open Microsoft.FSharp.Data.TypeProviders
open Microsoft.FSharp.Linq

[<EntryPoint>]
let main argv = 
    type dbSchema = SqlDataConnection<"Data Source=SQLDEV;Initial Catalog=CDDB;Integrated Security=SSPI;">
            let db = dbSchema.GetDataContext()
            // Enable the logging of database activity to the console.
            db.DataContext.Log <- System.Console.Out
            let query1 =
                query {
                    for row in db.SoundRecording do
                    select row
                    take 50
                }
            query1 |> Seq.iter (fun row -> printfn "%s - %s" row.DisplayArtist row.DisplayTitle)
            0 // return an integer exit code
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T15:46:17+00:00Added an answer on June 14, 2026 at 3:46 pm

    This may work – you can’t have type definitions inside functions

    open System
    open System.Data
    open System.Data.Linq
    open Microsoft.FSharp.Data.TypeProviders
    open Microsoft.FSharp.Linq
    type dbSchema = SqlDataConnection<"Data Source=SQLDEV;Initial Catalog=CDDB;Integrated Security=SSPI;">
    [<EntryPoint>]
    let main argv = 
    
                let db = dbSchema.GetDataContext()
                // Enable the logging of database activity to the console.
                db.DataContext.Log <- System.Console.Out
                let query1 =
                    query {
                        for row in db.SoundRecording do
                        select row
                        take 50
                    }
                query1 |> Seq.iter (fun row -> printfn "%s - %s" row.DisplayArtist row.DisplayTitle)
                0 // return an integer exit code
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to get some simple piece of code I found on a website
I have following piece of code, which should be able to log to console
I am using the following piece of code to get results from DB as
I have the following piece of python code. The code is supposed to get
I have written a piece of code, to get some information through the website
not able to get this, can someone help for this LINQ query? select col1,
I am able to get the current date, but I don't know how to
I am not able to get the hg head or status for a given
I am able to get the output of a pdf using fpdf, the problem
I'm not able to get this persistence file correct... I do not find any

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.