我试图拨打下面的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