我有一个用于从多个表中搜索的存储过程
`ALTER PROCEDURE [dbo].[rdsp_Srchfld]
(
@strFldlst as nvarchar(max),
@strTblnm as nvarchar(max),
@intSrchStyle as int,
@strcond1 as nvarchar(250),
@strCond2 as nvarchar(250)=null,
@strCond3 as nvarchar(300)
)
AS
BEGIN
declare @strSql as varchar(7000)
--Process
set @strSql = 'select Distinct ' + @strFldlst + ' from ' + @strTblnm
IF @intSrchStyle = 0
BEGIN
SET @strSql = @strSql + ' where ' + @strcond1 + ' = ' + '''' + @strCond2 + '''' + ' order by ' + '' + @strcond3 + ''
END
ELSE IF @intSrchStyle = 1
BEGIN
SET @strSql = @strSql + ' where ' + @strcond1 + ' like ' + '''' + @strCond2 + '%' + '''' + ' order by ' + '' + @strcond3 + ''
END
ELSE IF @intSrchStyle = 2
BEGIN
SET @strSql = @strSql + ' where ' + @strcond1 + ' like ' + '''' + '%' + @strCond2 + '%' + '''' + ' order by ' + '' + @strcond3 + ''
END
EXEC (@strSql)
END`
并将参数从 LINQ 传递到 Sql 作为
var rslt = from srch in custDC.rdsp_Srchfld(fldName, tblName, srchType, cond1, cond2, cond3) select srch;
现在我尝试构建我的程序,我收到错误
Error 1 Could not find an implementation of the query pattern for source type 'int'. 'Select' not found.
为什么我收到错误以及如何实现它。