How to update a table in database using LINQ in F#?

Posted by sudaly on Stack Overflow See other posts from Stack Overflow or by sudaly
Published on 2010-05-26T16:14:45Z Indexed on 2010/05/26 19:31 UTC
Read the original article Hit count: 172

Filed under:
|

I have seen plenty of examples on how to query the database but nothing on how to update records. Below is the simple code that I wrote to retrieve a table, but can someone explain me how can I modify a field, say lastActiveDate, and update the table on the database

Thank you, suday

open System
open Microsoft.FSharp.Linq

let connString = "Server=localhost;Database=myDb;Trusted_Connection=True;"
let db = new MyDb(connString)
db.Log <- System.Console.Out

let res =
    Query.query <@ seq {
        for users in db.userAccounts do
        yield users
     } @>
     |> List.ofSeq

printfn "Totla users: %d" res.Length

© Stack Overflow or respective owner

Related posts about LINQ

Related posts about F#