我的内联 sql 查询是这样的
DataSet ds = SqlHelper.ExecuteDataset(GlobalSettings.DbDSN, CommandType.Text,
"SELECT TOP 1000 [ID],[Project],[Owner],[Consultant],[Contractor],[Value],
[Level1], [Level2] ,[Status] ,[Category] ,[Country],[CreatedDate],
[CreatedByID], [CreatedByName]
FROM [DBname].[dbo].[tbl_Projects]
where [Category] like %@Category%
and Value=1000
and Country like'%Bahrain%'
order by CreatedDate",
new SqlParameter("@Category","oil") );
对我来说一切都很好。但它会引发错误
System.Data.SqlClient.SqlException: Incorrect syntax near 'Category'.
我相信这是我在使用类似查询时做错的事情。任何人都可以指出出了什么问题吗?