Can't get WHERE-syntax in place

  • Thread starter Thread starter Morten Snedker
  • Start date Start date
M

Morten Snedker

This is from my Query Analyzer:

select * from tblDokument
where CONTAINS(Content,'"*this-text*" and "*that-t*"')

I can't seem to get the quotation right in my rs.Open:

rs.Open("SELECT * FROM tblDokument WHERE CONTAINS(Content, ??, cn)


Thx in advance for your help! :-)

Regards /Snedker
 
Morten said:
This is from my Query Analyzer:

select * from tblDokument
where CONTAINS(Content,'"*this-text*" and "*that-t*"')

I can't seem to get the quotation right in my rs.Open:

rs.Open("SELECT * FROM tblDokument WHERE CONTAINS(Content, ??, cn)

VB.NET:
rs.Open("SELECT * FROM tblDokument WHERE CONTAINS(Content,
"""*this-text*"" and ""*that-t*""", cn)

C#:
rs.Open("SELECT * FROM tblDokument WHERE CONTAINS(Content,
"\"*this-text*\" and \"*that-t*\"", cn);

Though, I expect this is ado stuff, i.e.: vb6?

FB

--
 
On Tue, 01 Mar 2005 14:46:08 +0100, "Frans Bouma [C# MVP]"


First of all, thanks for your time and input.

Though, you guessed wrong - I am using VB.NET. But since you're
assuming VB6, I'm guessing that I'm doing something that's not
optimal...or not the proper .Net-way?

Regards /Snedker
 
You had "rs.Open", that looks very much like RecordSet.Open. That's ADo.
2.x, vb6ish - but hey nothing stops you from interoping that into VB.NET -
but most certainly you should try using ADO.NET instead.

But we're playing detectives here by judging that you are using ADO 2.x
based on "rs.Open" :)

- Sahil Malik
http://codebetter.com/blogs/sahil.malik/




Morten Snedker said:
On Tue, 01 Mar 2005 14:46:08 +0100, "Frans Bouma [C# MVP]"


First of all, thanks for your time and input.

Though, you guessed wrong - I am using VB.NET. But since you're
assuming VB6, I'm guessing that I'm doing something that's not
optimal...or not the proper .Net-way?

Regards /Snedker
VB.NET:
rs.Open("SELECT * FROM tblDokument WHERE CONTAINS(Content,
"""*this-text*"" and ""*that-t*""", cn)

C#:
rs.Open("SELECT * FROM tblDokument WHERE CONTAINS(Content,
"\"*this-text*\" and \"*that-t*\"", cn);

Though, I expect this is ado stuff, i.e.: vb6?

FB
 
Back
Top