Hi forum,
I have a doubt a SQL query, it works fine in the MS SQL Management Studio, but when I pass it to the code behind it does not work. This is the sql query in the SQL Management Studio that works:
select * from products, containstable(products, prod,'isabout("laptop acer" weight (1))') as resultado where products.ImageIDS = resultado.[Key] order by resultado.[Rank] desc
And this is the code behind with a query but it does not work:
Private Sub BindGrid2()
Dim use As SqlConnection
use = New SqlConnection("Data Source=DESKTOP-50SIV8B\SQLEXPRESS;Initial Catalog=cupon2; User ID=sa_conmigo; password=Twanging_11CRM2020")
use.Open()
Dim queryy As String = "select * from products, containstable(products, prod,'isabout('" + searcht.Text + "' weight (1))') as resultado where products.ImageIDS = resultado.[Key] order by resultado.[Rank] desc"
Dim DAA As SqlDataAdapter = New SqlDataAdapter(queryy, use)
Dim DTT As New Data.DataTable
searchid.Text = ""
subc.Items.Clear()
ids.Items.Clear()
DAA.Fill(DTT)
gv2.DataSource = DTT
gv2.DataBind()
use.Close()
End Sub
The issue is that I do not know why it does not work and how is the correct construction into the VB.NET.
Thanks!!!