本文介绍: SQL Statement:insert into ResTools values(null,’管理系统winform+Sqlite’,’项目\C#程序设计\C#winform项目\管理系统’,”,’Winform’,’0′,’0′)如果在C#调用的话使用。sqlite插入语句id自增列问题sqlite给主键id设置AUTOINCREMENT自增在插入数据的时候报错table has xcolumns but x-1 values were supplied 为什么自增列要显示不提供,sqlite

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

原文地址:https://blog.csdn.net/qq_28821897/article/details/135457138

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。

如若转载,请注明出处:http://www.7code.cn/show_57618.html

如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱:suwngjj01@126.com进行投诉反馈,一经查实,立即删除!

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注