我試圖撥打下面的SQL語句,但出現以下錯誤:的SqlParameter轉換
System.Data.SqlClient.SqlException: Conversion failed when converting the varchar value '[email protected]+' to data type int.
@"SELECT id, startDateTime, endDateTime
FROM tb_bookings
WHERE buildingID IN ('[email protected]+')
AND startDateTime <= @fromDate";
buildingID
在DB的int
類型列。我是否需要將ID作爲整數傳遞?
你可以發佈一些關於如何調用的代碼嗎? – Darksider 2008-10-08 11:18:33
這幾乎完全相同?作爲http://stackoverflow.com/questions/182060/sql-where-in-array-of-ids – Josef 2008-10-08 20:50:32