By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,679 Members | 1,063 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,679 IT Pros & Developers. It's quick & easy.

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

P: n/a
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?

--
Alan Silver
(anything added below this line is nothing to do with me)
Jul 19 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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
Alan Silver wrote:
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?

--
Alan Silver
(anything added below this line is nothing to do with me)
Jul 20 '06 #2

P: n/a
In article <11**********************@b28g2000cwb.googlegroups .com>,
ne**********@gmail.com writes
>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
>Alan Silver wrote:
>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?

--
Alan Silver
(anything added below this line is nothing to do with me)
--
Alan Silver
(anything added below this line is nothing to do with me)
Jul 20 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.