sqlite插入语句id自增列问题

sqlite给主键id设置AUTOINCREMENT自增在插入数据的时候报错table has x columns but x-1 values were supplied 为什么自增列要显示不提供,sqlite需要提供自增列table ResTools has 7 columns but 6 values were supplied

SQL Statement:insert into ResTools values('管理系统winform+Sqlite','项目\\C#程序设计\\C#winform项目\\管理系统','','Winform','0','0')

在管理工具中使用

insert into ResTools values(null,'管理系统winform+Sqlite','项目\\C#程序设计\\C#winform项目\\管理系统','','Winform','0','0')

如果在C#调用的话使用

string insertsql = string.Format("insert into diary values({0},'{1}','{2}','{3}')", "null", date, weather, text);

var inserttable = sqlhelper.ExecuteNonQuery(insertsql);

if (inserttable > 0)

{

var table = sqlhelper.GetDataTable(recentlysql);//查询

ViewBag.TableData = table;

}

else {

}

{0}不要加''

相关推荐
奈斯ing15 分钟前
【prometheus+Grafana篇】基于Prometheus+Grafana实现Redis数据库的监控与可视化
数据库·redis·缓存·grafana·prometheus
ningmengjing_19 分钟前
数据库——MongoDB
数据库·mongodb
海棠一号26 分钟前
JAVA理论第七章-MYSQL
java·数据库·mysql
_Chipen2 小时前
6.10 - 常用 SQL 语句以及知识点
数据库·sql·oracle
青春之我_XP3 小时前
【SQL学习笔记1】增删改查+多表连接全解析(内附SQL免费在线练习工具)
数据库·sql
焱焱枫3 小时前
Oracle SQL*Plus 配置上下翻页功能
数据库·oracle·#上下翻页
qq_390934743 小时前
MySQL中的系统库(简介、performance_schema)
android·数据库·mysql
胡斌附体3 小时前
mysql为什么一个表中不能同时存在两个字段自增
数据库·mysql·自增字段·auto increment
AllWe$3 小时前
十、MySQL InnoDB引擎底层解析
java·数据库·mysql