C# MySQL参数

C# MySQL参数,c#,mysql,C#,Mysql,当我在不使用?auth参数的情况下使用下面的代码时,它可以正常工作 MySqlCommand createAccount = new MySqlCommand("INSERT INTO "+ Properties.Settings.Default.mysqlauth +".`account` (`username`, `sha_pass_hash`, `email`, `expansion`) VALUES (?username, ?pass, ?email, ?

当我在不使用?auth参数的情况下使用下面的代码时,它可以正常工作

                MySqlCommand createAccount = new MySqlCommand("INSERT INTO "+ Properties.Settings.Default.mysqlauth +".`account` (`username`, `sha_pass_hash`, `email`, `expansion`) VALUES (?username, ?pass, ?email, ?exp);", connector.connection);
                //createAccount.Parameters.AddWithValue("?auth", Properties.Settings.Default.mysqlauth);
                createAccount.Parameters.AddWithValue("?username", user);
                createAccount.Parameters.AddWithValue("?pass", hexHash);
                createAccount.Parameters.AddWithValue("?email", email);
                createAccount.Parameters.AddWithValue("?exp", expVer);
但是,当我添加数据库名称参数时,我得到一个致命错误

                MySqlCommand createAccount = new MySqlCommand("INSERT INTO ?auth.`account` (`username`, `sha_pass_hash`, `email`, `expansion`) VALUES (?username, ?pass, ?email, ?exp);", connector.connection);
                createAccount.Parameters.AddWithValue("?auth", Properties.Settings.Default.mysqlauth);
                createAccount.Parameters.AddWithValue("?username", user);
                createAccount.Parameters.AddWithValue("?pass", hexHash);
                createAccount.Parameters.AddWithValue("?email", email);
                createAccount.Parameters.AddWithValue("?exp", expVer);
我不明白这里出了什么问题,不是吗


另外,我试过使用@符号,但没有改变任何事情。

?for bind变量已弃用。你应该用@符号。不能对表名和列名使用绑定参数。绑定参数无法更改SQL语句的结构,因为数据库将准备SQL语句,并且需要知道该语句引用的表,以确定要执行的查询计划。

您得到的“致命错误”是什么?@justiniessner I get back“在命令执行期间遇到致命错误”