How to adapt full-text search query for Visual Basic

I am creating a Visual Basic 2005 application for doing full-text searches on a SQL Server 2005 database. I am able to do FT searches in SQL Server 2005 Management Studio. I am also able to do “LIKE” searches on the database in my VB application, but have not yet been able to get the FT search to work in the VB application which utilizes a button, textbox, and listbox to search and retrieve results based on words typed into the textbox.

Here is the query that I use in Management Studio to do a FT search on “radio” in the SectionText column of the FullDocuments table:

SELECT FullDocNo

FROM FullDocuments

WHERE CONTAINS (SectionText, ' "radio" ');

Here is the query that I use for the LIKE comparison in my VB application:

SELECT FullDocNo

FROM FullDocuments

WHERE SectionText LIKE @SearchText

I have tried to modify it for the FT query in the VB app in various ways, including:

SELECT FullDocNo

FROM FullDocuments

WHERE CONTAINS(SectionText, '@SearchText');

Which results in a warning that the SQL statement is not supported. Any suggestions on how to modify my FT search query so that it is supported in VB 2005



Answer this question

How to adapt full-text search query for Visual Basic

  • How to adapt full-text search query for Visual Basic