不執行請求: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