Re: FTS Weighted Values Implementation Problem



Still getting a syntax error with ( + RealWeight1.ToString() + ),

System.Data.SqlClient.SqlException was unhandled
Class=15
ErrorCode=-2146232060
LineNumber=1
Message="Syntax error near 'RealWeight1.ToString' in the full-text
search condition 'ISABOUT ("gold" weight ( + RealWeight1.ToString()
+ ), "silver" weight (.4), "copper" weight (.2) )'."

When I stepped through it in debug mode, there was no value assigned
to RealWeight1.To String().

If I cast to string datatype before the Select statement:

Dim Weight1 As Integer
Weight1 = WeightTextBox1.Text
Dim RealWeight1 As Double
RealWeight1 = Weight1 * 0.1
RealWeight1 = RealWeight1.ToString

and use string syntax in the Select statement:

(""" + RealWeight1 + """),

and step through it in debugger, the value of RealWeight1 in the
Select statement is 0.8 (as it should be). But this is a string
value, not double or decimal.

I am wondering if the Select statement is looking for a double or
decimal datatype for the weight value? So even if a string is
provided with the correct value (e.g., 0.8), it is not accepted
because it is the wrong datatype?

I am learning a lot here (I think), and am confident I will get this
to work with your help. Greatly appreciate your patience and
expertise.

On Sep 3, 1:12 pm, "Jean-Pierre Riehl" <jean-pierre.ri...@xxxxxxxxxxxxxx> wrote:
It is another VB.NET syntax problem ;-)

You have to convert your numeric value to string with ToString() function.
Double quote are useless as you expect that result : weight(0.8)

New query is :
[...] 'ISABOUT (""" + SearchTerm1 + """ weight ( + RealWeight1.ToString()
+ ), """ + SearchTerm2 [...]

--
Jean-Pierre Riehlhttp://blog.djeepy1.nethttp://www.bewise.fr

"Organic Man" <davidmcmil...@xxxxxxx> wrote in message

news:1188837558.402664.317710@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx


.



Relevant Pages

  • Help!! Oracle 9.2.0.5.0 wont properly read the *.rsp
    ... #Datatype: String ... #Datatype: Boolean ... #This page shows the current status in the installation. ...
    (comp.databases.oracle.server)
  • Re: GOSUB, the larger picture (was Worldwide known Excellence of GOSUB)
    ... > does not mean that was not a hack. ... Yep, a Byte datatype was indeed needed, and welcome! ... No need to break String, ... It aint bigger Karl, ...
    (microsoft.public.vb.general.discussion)
  • Re: Access Query Right Align
    ... Gary - The DataType is text for all fields. ... Dim hFile As Long ... Dim strPath As String ... Dim strTextLine As String ...
    (microsoft.public.access.queries)
  • Re: converting data to null using DBNull problem
    ... the DBNull Object can only be set to a String type so ... setting the datatype here to other than string type would cause an error. ... It is possible to set the datatype here though and use thte Parse function ...
    (microsoft.public.sqlserver.dts)
  • Re: Get Data Type
    ... the data types of the resultant columns - similiar to the decisions made by ... If I then needed to find out what datatype these variables were I could use: ... wanted to know if a string represented a positive long integer then I would ...
    (microsoft.public.access.modulesdaovba)

Loading