需要此Sqlexeption的帮助 [英] need help for this Sqlexeption

查看:67
本文介绍了需要此Sqlexeption的帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我想将数据添加到我的数据库"SQL Server",并且遇到了这个问题

http://img4.hostingpics.net/pics/907154Sanstitre.png [

hi guys,

I want to add data to my database "SQL Server" and i have meet this problem

http://img4.hostingpics.net/pics/907154Sanstitre.png[^]

what is the problem? what do I need to do?

推荐答案

列名或提供的值数与表定义不匹配: INSERT,其中未指定列列表,并且通过VALUES子句或SELECT子查询插入的值大于或小于表中的列.

因此,请确保数据库表中的字段数和在插入查询中传递的值相同.
并且如果您已在数据库表中将字段标记为自动递增,则检查身份规范设置为true(在插入查询中不要为该字段提供值).

希望对您有所帮助:)

有关进一步的查询,请在此处进行评论!!!!
Column name or number of supplied values does not match table definition:This error occurs when doing an INSERT where the columns list is not specified and the values being inserted, either through the VALUES clause or through a SELECT subquery, are either more than or less than the columns in the table.

hence make sure that number of fields in database table and values passed in insert query are same.
and if you have mark a field as auto-increment in database table then check identity specification is set true(don''t give value for this field in your insert query).

hope it helps :)

for further queries comment here !!


从以下位置更改您的SQL语句:
Change your SQL statement from:
INSERT INTO Etudiant VALUES (@N, @P)

INSERT INTO Etudiant (myColumnN, myColumnP) VALUES (@N, @P)

我没有看到表定义,我想您有两列以上,而第一列不是文本...

Without seeing your table definition, I am guessing that you have more than two columns, and the first one isn''t text...


我认为问题不言而喻.


这篇关于需要此Sqlexeption的帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆