string insertCommand = "INSERT INTO Users (UserID) VALUES ('"+UsersIdentityToinsert+"')"; //Exception: Cannot insert the value NULL into column 'Reputation', table 'model.dbo.Users'; column does not allow nulls. INSERT fails.
该语句已被终止。编写简单的SELECT查询时出现问题
当我用sqlCommand.ExecuteNonQuery();执行此命令。它说我不能将空值放入列中。但在调试中,我看到UsersIdentityToinsert有一个Guid值
1.这没有任何意义,你的散文与代码不符。发布您的问题的完整重新创建(但不超过)。 2.不要使用字符串连接来构建SQL,它会导致SQL注入攻击。 – Richard 2011-05-29 10:55:38
你初始化了'checkExistingUserID'吗? – 2011-05-29 10:57:26
好吧,不,我刚刚喂了一些值 – Matrix001 2011-05-29 11:11:39