Click here to Skip to main content
15,909,827 members

Comments by PaulVeeVee (Top 5 by date)

PaulVeeVee 5-Jul-11 21:43pm View    
Hi Marcus .... I tried adding the parameter like this too :
SqlParameter param = new SqlParameter("@Argument" + parameterIndex, SqlDbType.NVarChar);
param.Direction = ParameterDirection.Input;
string argValue = searchItem.Trim().Replace('_', ' ');
param.Size = argValue.Length;
sql.Parameters.Add(param).Value = searchItem.Trim().Replace('_', ' ');

But it still returns no results. So, I don't think the variable size is the problem. Any other thoughts?
PaulVeeVee 5-Jul-11 21:32pm View    
Hi Marcus, thank you for the reply - I tried it adding the parameter like this :

sql.Parameters.Add("@Argument" + parameterIndex, SqlDbType.NVarChar).Value = searchItem.Trim().Replace('_', ' ');

the searchItem is string

Should that be large enough? It still doesn't work though. Thanks!!
PaulVeeVee 30-Jun-11 0:53am View    
Hi JOAT-MON
That worked!! I have to admit, and I'm very embarrased, but I think my original first block of code also works, but your last one did too. It was my mistake as I kept getting no results when my data may have actually changed where it didn't have that combination of phrase / word. Again, thank you so much for all of your help!!

PTV
PaulVeeVee 30-Jun-11 0:15am View    
Hi JOAT-MON ... I really appreciate your trying to help. Unfortunately on that version I get this :
Msg 156, Level 15, State 1, Line 7
Incorrect syntax near the keyword 'AND'.
An expression of non-boolean type specified in a context where a condition is expected
(the whole section ---AND 'FORMSOF(INFLECTIONAL, Huntsville)');--- has the red squiggly line under it, so I could tell it wasn't liking it before I tried to Execute).
Any other tries? Thanks!
PaulVeeVee 29-Jun-11 23:36pm View    
Hi JOAT-MON ...thanks for the message. I tried that and received the following error :
Msg 7630, Level 15, State 3, Line 2
Syntax error near 'AND' in the full-text search condition 'FORMSOF(INFLECTIONAL,"Windows Administrator" AND Huntsville)'.

Any other thoughts? Thanks!