- , SqlBuilder, , ExecuteScalar()
select count(*) from information_Schema.tables where table_name = @tbl
If the result was> 0, then I would use the following (if the result is 0, then you should come off)
string sql = "Select a, b, c from ["+tblName+"]"
This is dirty, but using an information scheme should ensure that the table name exists in the database and that the variable contains nothing to the contrary.
source
share