I would like to use a parameter for the table name in the select statment of the SqlCommand. I have :
s = new SqlCommand("SELECT * FROM @table",connection2);
s.Parameters.Add("@table",SqlDbType.VarChar,4).Value = vendor;
But it doesnt seem to like that and errors out? It says must declare the variable @table
If i have it like:
s.Parameters.Add("table",SqlDbType.VarChar,4).Value = vendor;
It errors out and says "incorrect syntax near "table"