I do not believe that there is a specific problem with referencing tables, in C#, having names starting with
@. I was able to create a table with a name of
@TableName and was able to execute
SELECT SUM(Col1) FROM [@TableName]; successfully. I used
SqlCommand, not EF or
DataTable. Are you sure that you are connecting to the database that contains this table?
Most likely the error message is very accurate and you are not in the correct database. Either specify the desired database in the Connection String, or use a fully qualified name:
Of course, if you have a choice, then you should not choose to name any object starting with
@ as that is the symbol used to denote local variables, system variables, and input/output parameters.