1. 程式人生 > >:“You have an error in your SQL syntax; check the manual that corresponds to your MySQL server versi

:“You have an error in your SQL syntax; check the manual that corresponds to your MySQL server versi

今天用C#連線資料庫的時候,想把欄位名改成中文,結果就報這個錯誤了,:“You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘??? FROM tik_integral_detail’ at line 1”

解決方案

mycom.CommandText = "SELECT id AS `使用者名稱` FROM tik_integral_detail";

在英文狀態下輸入`,這個符號是鍵盤左邊數字鍵1的左邊那個符號(只能在英文狀態下解決)