0

嘿,我在 MySQL 中使用 Dapper.Contrib 出现语法错误

MySQL server version for the right syntax to use near '[cause_code],[cause_name]) values ('000-DDH', 'No Money')' at line 1

在 mysql 中插入的正确语法是

"Insert Into `tbl_cause` (`cause_code`, `cause_name`) VALUES('blah', 'blah')"; 

我的代码:

var entity = new Cause { cause_code = "000-DDH", cause_name = "No Money" };
        using (IDbConnection cn = ConStr.Conn()) 
        {
            long ins = cn.Insert(entity);
            if (ins > 0)
            {
                MessageBox.Show("Cause Code: " + entity.cause_code + " Successfully Added!");
                GDRD();
            }
            else {
                MessageBox.Show("Cause Code: " + entity.cause_code + " While trying to Add an Error Occurred!");
            }
        }

如何解决这个问题?提前致谢

4

1 回答 1

0

又是你 :) 班级CauseTable("tbl_cause")指令吗?在此处阅读 dapper contrib 扩展文档

于 2016-04-22T18:21:29.770 回答