Reputation: 1171
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
@
and ä
characters are allowed characters andDoes anybody know how to solve this problem?
Upvotes: 0
Views: 117
Reputation: 1171
The wizard requires the use of square brackets for a SQL database. The correct query is then the following:
SELECT Modell FROM BHKW WHERE Energieträger = [@Energieträger]
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:
SELECT Modell FROM BHKW WHERE (Energieträger = ?)
Upvotes: 1