I am getting an error with an SQL statement:
must declare the table variable @table
I don't know how I should fix it. Here is the code for the part that makes the query (for example 3 is Communications, 4 is Radio:basic, 5 is 45, 6 is 5, and 7 is 0).
string table = "Skills" + info[3];
SqlCommand cmd = new SqlCommand("use palladium; insert into @category(skill, basepercent, lvlpercent, special) values ( @skillname , @base , @lvl , @special);");
cmd.Parameters.AddWithValue("@category", table);
cmd.Parameters.AddWithValue("@skillname", info[4]);
cmd.Parameters.AddWithValue("@base", info[5]);
cmd.Parameters.AddWithValue("@lvl", info[6]);
cmd.Parameters.AddWithValue("@special", info[7]);
general.dbsend(cmd, connection);
var query = string.Format("use palladium; insert into {0}(....", table);and use it asSqlCommand cmd = new SqlCommand(query);