无法插入身份字段
我的 Windows CE 程序有问题 我使用 Visual Studio 2005 在模拟器中测试了我的代码并且运行良好 该程序应该在来自 ms 服务器的表中插入一个数字,但是当我尝试在真实设备中运行我的程序时,我收到错误,因为尝试在非空字段中插入空值
这是一个多表
id (int) <<-- this field is a identity
codigo (int)
这是我的插入查询:
INSERT INTO codigos (codigo) VALUES variable_codigo
我不知道为什么在模拟器中有效,但在真实设备中却无效=/
Thnks
I have a problem with a windows CE program
I tested my code in an emulator with my visual studio 2005 and works nice
The program should insert a number in a table from ms server but when i tried to run my program in the real device i get the error from try to insert null value in a non-null field
This is muy table
id (int) <<-- this field is a identity
codigo (int)
And this is my insert query:
INSERT INTO codigos (codigo) VALUES variable_codigo
I dont know why in the emulator works but in the real device not =/
Thnks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您的列名称不匹配(是
coding
还是codigo
),您的VALUES
语法不正确,并且您尚未定义您的表的架构。也许在不同的模式下有多个同名的表,或者存在其他一些粗心的错误(正如 Mikael 所建议的,我怀疑该列不是 IDENTITY 列或者您正在查看错误的表)。Your column names don't match (is it
coding
orcodigo
), yourVALUES
syntax isn't correct, and you haven't defined the schema for your table. Perhaps there are multiple tables with the same name under different schema, or there is some other careless error going on (as Mikael suggested, I suspect that either the column is not anIDENTITY
column or you are looking at the wrong table).检查 Id col 是否
check if Id col is identity