When running some sort of check on F# before the the next phase. I decided to record some difficulties during the process and hopefully make our F# user's life easier. You can ignore this if you have already what is going on.
the query below is perfectly fine, right? At first glance, it is. But the exception soon throw at your face, make you wondering what could be the problem.
let internal q1 = query {
for n in db.Course do
select (sprintf "course name = %s" n.CourseName) }
let result1 = showResult q1
for n in db.Course do
select (sprintf "course name = %s" n.CourseName) }
let result1 = showResult q1
It is the because the sprintf can not be translated to the server side statements; however, the cause does not help you solve the problem. The fix is to move the computation to client side.
let internal q1 = query {
for n in db.Course.AsEnumerable() do
select (sprintf "course name = %s" n.CourseName) }
Hopefully this can save you several F words .. :-D
for n in db.Course.AsEnumerable() do
select (sprintf "course name = %s" n.CourseName) }
Hopefully this can save you several F words .. :-D
No comments:
Post a Comment