I try a select command with the table as parameter:
...
mySqlSelectCommand1.CommandText = "select * from :Tablename";
mySqlSelectCommand1.Parameters.Add(new CoreLab.MySql.MySqlParameter("Tablename", CoreLab.MySql.MySqlType.VarChar));
mySqlSelectCommand1.Parameters["Tablename"].Value = "testreports";
...
The result on execution is the following error:
CoreLab.MySql.MySqlException wurde nicht von Benutzercode behandelt.
Message="You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ''testreports'' at line 1"
Source="CoreLab.MySql"
ErrorCode=-2147467259
Code=1064
...
The DBMonitors shows:
Execute: select * from :Tablename
Params:
Tablename Input VarChar testreports
Error:
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ''testreports'' at line 1
Without using this parameter it works.
Anything special to do to use a parameter as the tablename? Or is it unpossible to use a parameter as tabelname?