sql server - convert SQL full text index statement originally in double qoutes for vb, with c# -


i have inherited sql statement written vbscript need convert use in c#. written full text index search in vbscript , classic asp.

the problem believe double quotes. here original statement...

select * ejn_expandeddescriptions ft_tbl inner join containstable(ejn_expandeddescriptions, searchindex, '""" & txtformdesc & "*""', 50) key_tbl on ft_tbl.id = key_tbl.[key] att10='current' order key_tbl.rank desc

notice use of double qoutes in section...

'""" & txtformdesc & "*""'

i need convert string c# , pass parameter, @txtformdesc, string must include asterisk. here sample code understand should way fix (from https://docs.microsoft.com/en-us/sql/t-sql/queries/contains-transact-sql...)

use adventureworks2012;   go   select name   production.product   contains(name, '"chain*" or "full*"');   go  

from code assuming there needs double quotes in statement. have tried use "/ in replace of of double quote in c# not let me. tried using following code...

select txtitema ejn_expandeddescriptions ft_tbl inner join containstable(ejn_expandeddescriptions, searchindex, ' @txtformdesc" + "*' , 50) key_tbl on ft_tbl.id = key_tbl.[key] att10 = 'current' order key_tbl.rank desc

this still results in error.

if use statement without asterisk, works on single words not more 1 word, (which above statement supposed do).

select txtitema ejn_expandeddescriptions ft_tbl inner join freetexttable(ejn_expandeddescriptions, searchindex, @txtformdesc, 50) key_tbl on ft_tbl.id = key_tbl.[key] att10='current' order key_tbl.rank desc

i have tried no luck...

select txtitema ejn_expandeddescriptions ft_tbl inner join containstable(ejn_expandeddescriptions, searchindex, '@txtformdesc" + "*' , 50) key_tbl on ft_tbl.id = key_tbl.[key] att10 = 'current' order key_tbl.rank desc

i need create statement works in c# able pull off corrected conversion original form in vbscript, work in c# string accepting paramater @txtformdesc, using asterisk.


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -