0

I'am using the official MySql Driver for ADO.NET and I have problems to query my database.

With the MySQL Workbench tool on my server, my SQL-Query works without any problems.

The Adapter DLL is throwing the following message with the same query:

MySql.Data.MySqlClient.MySqlException: Unknown column 'CatPro.CategorieId' in 'on clause'

The column CategorieId exists definitely.

Perhaps, anyone has experiece with the MySql DataAdapter and a idea to solve this issue.

SELECT Pro.Id AS ProductId, 
       Pro.Name AS ProductName, 
       ProInfo.Id AS ProductInfoId ,
       ProInfo.GeneralDescription, 
       Cat.Title AS CategoryTitle  
       FROM Products AS Pro
       LEFT JOIN subproducts AS ProInfo ON Pro.Id = ProInfo.Id
       LEFT JOIN subproductcategories AS CatPro ON ProInfo.Id = CatPro.SubProductId
       LEFT JOIN categories AS Cat ON Cat.Id = CatPro.CategorieId ORDER BY Pro.Id

Best regards

Patrik
  • 1,119
  • 5
  • 18
  • 37
  • Can you post the entire SQL statement? You may be using table aliases in your `JOIN` but not in your column sleection. – D Stanley Feb 10 '14 at 22:10
  • Hey, thx for answering. The strange is, this query, runs in the Workbench tool. – Patrik Feb 10 '14 at 22:16
  • The column `CategorieId` exists in the table subproductcategories, right? Have you tried to use the actual table name instead of the `CatPro` alias? – Tasos K. Feb 10 '14 at 22:28
  • Hey, same error.. Unknown column 'subproductcategories.CategorieId' in 'on clause' – Patrik Feb 10 '14 at 22:31

0 Answers0