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}不要加''

相关推荐
Arva .39 分钟前
深分页与游标
数据库·oracle
idolao1 小时前
MySQL 5.7 安装教程:详细步骤+自定义安装+命令行客户端配置(Windows版)
数据库·windows·mysql
20年编程老鸟java+ai全栈2 小时前
mysql、pg、oracel数据库迁移避坑指南
数据库·mysql
Rsun045512 小时前
Redis中实现访问量计数
数据库·redis·缓存
天空属于哈夫克32 小时前
自动化素材中枢:实现云端文件与外部群消息的异步同步方案
数据库·oracle
Navicat中国3 小时前
Navicat Premium Lite 正式登录鸿蒙应用市场
数据库·华为·harmonyos·navicat
Yvonne爱编码3 小时前
数据库---Day 1 数据库基础
数据库·mysql·oracle
Ricky_Theseus3 小时前
数据库关系代数 - 连接操作
linux·数据库·算法
2301_793804693 小时前
定时任务专家:Python Schedule库使用指南
jvm·数据库·python
guslegend3 小时前
MySQL高手第三章
数据库·mysql