In Visual Studio 2010, I am using the wizard to create queries for TableAdapters. The query SELECT Modell FROM BHKW WHERE Energieträger = @Energieträger causes “Error around @ character” to appear (within the wizard). And this event though
- the
@andächaracters are allowed characters and - this very simple query comes from an official Microsoft example (only the field names have been changed).
Does anybody know how to solve this problem?
The wizard requires the use of square brackets for a SQL database. The correct query is then the following:
If you use an Access database, the wizard will complete successfully but a warning will pop-up: “Returned data does not conform to the table’s schema.”
The correct syntax with an Access database requires a question mark: