出现这种情况的原因,是因为在SQL语句的编写格式不正确。
事例展示:
错误:
string sql = "insert into person ([name], sex, salary) values ('text_name ', 'text_sex ', text_salary )";
正确:
string sql = "insert into person ([name], sex, salary) values ('" + text_name + "', '" + text_sex + "', '" + text_salary + "')";