2013-10-03 48 views
4

獲得一個語法錯誤,用下面的查詢:語法錯誤(缺少操作員) - ASP.NET

strSQL = "SELECT Customer.customer_No, Customer.customer_Name, 
       Appointment.appointment_No,Appointment.appointment_Date, 
       Appointment.start_Time, Appointment.end_Time 
      FROM Customer 
      INNER JOIN Vehicle 
       ON Customer.customer_No = Vehicle.customer_No 
      INNER JOIN Appointment 
       ON Vehicle.vehicle_Ref_No = Appointment.vehicle_Ref_No" 

我試圖在SQL Server Management Studio中相同的查詢,並獲取數據,我需要。不知道問題是什麼,任何幫助將不勝感激。

+3

你可以發佈代碼片段的其餘部分 - 命令是如何初始化和使用的? –

+1

請發佈錯誤。這會有所幫助。 – pordi

回答

0

試試這個:

strSQL [email protected]"SELECT Customer.customer_No, Customer.customer_Name, 
       Appointment.appointment_No,Appointment.appointment_Date, 
       Appointment.start_Time, Appointment.end_Time 
      FROM Customer 
      INNER JOIN Vehicle 
       ON Customer.customer_No = Vehicle.customer_No 
      INNER JOIN Appointment 
       ON Vehicle.vehicle_Ref_No = Appointment.vehicle_Ref_No" 

@將讓你寫多行和使用轉義字符。

相關問題