我尝试使用Dapper插入到我的MS Access数据库中,现在查询数据工作正常,但是当我尝试插入时,我得到System.Data.OleDb.OleDbException : Data type mismatch in criteria expression
代码是:
let conn = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=path;Persist Security Info=False;")
let exec f =
try
conn.Open()
do f()
finally
conn.Close()
[<CLIMutable>]
type Timecard =
{ Id : int
Employee : string
WorkDate : DateTime
Hours : int
Description : string
BillType : string }
exec (fun () ->
let tc = { Id = 0
Employee = "John Doe"
WorkDate = DateTime.Today
Hours = 10
Description = "working 9 to 5"
BillType = "BillableInternal" }
conn.Execute("insert into Timecards (Employee, WorkDate, Hours, Description, BillType) values (@Employee, @WorkDate, @Hours, @Description, @BillType)", tc)
|> ignore)