これは私が取得していますエラーです:のフルテキスト検索ストアドプロシージャのエラー
Syntax error near 'online' in the full-text search condition '""online"*" and "and*" and ""text"*"'.
これは私のストアドプロシージャ:
ALTER PROCEDURE dbo.StoredProcedure1
(
@text varchar(1000)=null
)
AS
SET NOCOUNT ON
declare @whereclause varchar(1000)
SET @whereclause = @text
SELECT articles.ArticleID AS linkid,
articles.abstract as descriptiontext,
articles.title as title,
'article' as source,
articles.releasedate as lasteditdate
FROM articles
WHERE CONTAINS(title, @whereclause)
ORDER BY lasteditdate DESC, source ASC
この私がSPに渡す:
string content = "\"online\" and \"text\"";
C#コードの一部:
using (SqlConnection cn = new SqlConnection(this.ConnectionString))
{
SqlCommand cmd = new SqlCommand("StoredProcedure1", cn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@text", SqlDbType.VarChar).Value = searchExpression;
cn.Open();
UPDATE:
私がしようと文字列と私は取得エラー:
content = "online text";
Syntax error near 'text' in the full-text search condition 'online text'.
content = "\"online\" and \"text\"";
Syntax error near 'online' in the full-text search condition '""online"*" and "and*" and ""text"*"'.
content = "\"online and text\"";
Syntax error near 'online*' in the full-text search condition '""online*" and "and*" and "text"*"'.
このSPを実行するC#コードを与えてください。 –
@ Sergey Olontsev、done – markiz