不执行请求:c#。 MySQL的。 “插”。错误
mycmd = new MySqlCommand();
mycmd.CommandText = "INSERT INTRO 'users' (userid, username, password, ipaddr, port, channel, inbox, inboxadm, access, other) VALUES (NULL, 'username2', 'password2', NULL, NULL, 'channel2', NULL, NULL, 'access2', NULL);";
mycmd.Connection = mconnection;
mycmd.Parameters.AddWithValue("username2", message.Login);
mycmd.Parameters.AddWithValue("password2", message.Password);
mycmd.Parameters.AddWithValue("channel2", "channel");
mycmd.Parameters.AddWithValue("access2", 0);
mycmd.CommandType = CommandType.Text;
mycmd.ExecuteNonQuery();
帮助找到并要求纠正错误。
Exapmle phpmyadmin的SQL查询:
INSERT INTO `shachat`.`users` (`userid`, `username`, `password`, `ipaddr`, `port`, `channel`, `inbox`, `inboxadm`, `access`, `other`) VALUES (NULL, 'myacc', 'mypass', NULL, NULL, 'administratorY', NULL, NULL, '9', NULL);
请指定您收到的错误消息 –
可能有助于指定您的错误,为我们定义架构并添加任何其他相关详细信息。 –
错误不存在,在“mycmd.ExecuteNonQuery();”之后不会出现。 – BrainOverflow