Easy-to-follow examples of CRD (Create, Read, Delete) appear in MSDN here
There is a nice link on the page to a script to make a test database, and I did so, and easily
I haven't had a chance to try the new query
expressions yet -- so this is just a guess:
query { for row in db.Table1 do
where (row.TestData1 <= 10)
select row }
|> Seq.iter (fun row ->
// Update the row with some new value.
row.TestData1 <- row.TestData1 + 1)
// Now, call .SubmitChanges() to execute the SQL and update the database
try
db.DataContext.SubmitChanges()
printfn "Successfully updated the rows."
with
| exn -> printfn "Exception:\n%s" exn.Message
The code on this page gives another example of how this works, albeit in C#. Basically, the F# query
expression is (in this case) simply wrapping Linq-to-SQL; so if the code I posted doesn't work, you should take a look at some of the new .NET 4.5 examples of Linq-to-SQL with C#.