Can't I use a parameter with containstable in a strongly typed dataset?

A

Alan Silver

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 containstable (free text
searching).

If I enter a parameter in the containstable clause of a query...

containstable(TaxTips, TipTitle, 'isabout (@kwords)')

....then VS doesn't recognise it as a parameter, and marks the data
method as not taking any parameters.

I tried hacking the code of the .xsd file, but that didn't work, and is
also very flaky as VS will overwrite my changes as soon as I do anything
in the dataset designer.

So, anyone any ideas? I like the DataSet, but I need to be able to use
it with containstable. Can this be done?
 
N

neilmcguigan

your parameter is wrapped with single quotes so it is treated as a
literal

change to

containstable(TaxTips, TipTitle, @kwords)

then set the value of @kwords to 'isabout ' + somevalue

where somevalue is a literal value
 
A

Alan Silver

your parameter is wrapped with single quotes so it is treated as a
literal

change to

containstable(TaxTips, TipTitle, @kwords)

then set the value of @kwords to 'isabout ' + somevalue

where somevalue is a literal value

Thanks, I tried that after I posted, and couldn't get it to work. I
realised afterwards that the problem wasn't with the DataSet at all, it
was with a radiobutton value that I was checking. I was getting the
"wrong" results, not because the containstable wasn't working, but
because the wrong code was being called!!

Thanks for the help
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top