473,397 Members | 1,960 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

CONTAINSTABLE Statement - Help please!

Hello All:

I have been struggling to find out what could possibly be wrong with this
piece of code. From my understanding of the CONTAINSTABLE Function and using
parameters with a query, this should work. Obviously, I'm missing something!
I have confirmed that the variable strField does contain the proper value to
be used in the CONTAINSTABLE function. For whatever reason, it does not like
the syntax of it. Please take a look.... any suggestions appreciated!

- Brian

' Take the selected value of the drop down box and put it in strField
strField=DropDown.SelectedValue

' Return the value of strField to confirm what it contains
Button1.Attributes.Add("onclick","return confirm('" & strField & "');")

' Define SQL Connection parameters
conTorontoHardware = New SqlConnection( "server='*****';
trusted_connection=true; database=WorkstationsServers" )

' The SQL statement *PROBLEM* It's says: incorrect syntax near @Dropdown
strSearch = "SELECT RANK, * FROM WorkstationsServers," & _
"CONTAINSTABLE( WorkstationsServers, @Dropdown, @searchphrase )
searchTable " & _
"WHERE [KEY] = WorkstationsServers.WSID " & _
"ORDER BY RANK DESC "
cmdSearch = New SqlCommand( strSearch, conTorontoHardware )
With cmdSearch.Parameters:
.Add(New SQLParameter("@Dropdown", strField))
.Add(New SQLParameter("@searchphrase", txtSearchphrase.Text))
End With
conTorontoHardware.Open()
Nov 18 '05 #1
0 1234

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jay | last post by:
G'day all This registration form checks for the submit button then displays the next form from the include statement. But before it displays the next form it will check to make sure the user...
15
by: PagCal | last post by:
Is this language missing the functionality of a C/C++ 'continue' statement? For example: While NOT isEof() If condition ' a C or C++ continue would work here ' but we are forced to use a...
14
by: Matt | last post by:
I need to add the following variable into an SQL statement and not sure how to do it. strGCID needs to be inserted into the following statement: SQL = "SELECT tblContacts.* FROM tblContacts...
2
by: Alan Silver | last post by:
Hello, I have been trying the DataSet in VS2005, to see if it will simply some basic data access. So far it seems very useful, but I have run into a problem when trying to use a parameter for...
1
by: Nate | last post by:
I am using the following query to search all columns in the 'dashboard' table for the value 'Meets': SELECT * from dashboard AS FT_TBL INNER JOIN CONTAINSTABLE(dashboard,*, 'meets') AS KEY_TBL...
1
by: jeffejohnson | last post by:
I'm trying to write a query to associate to an alternate key. Can someone provide the right syntax/keyword I need to accomplish this? Here's the line that keeps giving me the error (Operand type...
6
by: Kbalz | last post by:
Trying to run a simple query on my dataset the SQL statement looks like this: select * from person where id in (@p) When using more than one id in the "in statement", I get...
18
by: dspfun | last post by:
Hi! The words "expression" and "statement" are often used in C99 and C- textbooks, however, I am not sure of the clear defintion of these words with respect to C. Can somebody provide a sharp...
0
by: padmajapenmetsa | last post by:
Hi, We have the full text search table and are using CONTAINSTABLE to search in the fulltext search column, its workingfine, but we have a requirement that we need to return results which match a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.