Loading

Help: MR ADMIN in syntax of NOT LIKE operator in VB.Net

8 posts / 0 new
Last post
michelle_paradero's picture
Offline
Joined: 11/10/2009
Help: MR ADMIN in syntax of NOT LIKE operator in VB.Net

Please anyone i need help regarding the syntax of NOT LIKE. im using VB 2008 and SQL 2005. in one of my reports i use these code to show all employees with positon starting witn ADMIN.... the code is these:

strWhere = "{qryInvent.SG} < 23 AND {qryInvent.CurPosition} LIKE '*CM*'"

now i want to show the opposite..the NOT LIKE but these syntax do not run.
here is the code just opposite of the one above.

strWhere = "{qryInvent.SG} < 23 AND {qryInvent.CurPosition} NOT LIKE '*CM*'"

i think the syntax is wrong. please help me.thanks

cedrick blas's picture
Offline
Joined: 09/13/2009
halow

can u teach me how to create a report? rdlc or crystal..
ive created something but when i change the path of my database i got an error stating that the path is not valid.

i want it programatically like the report of visual basic 6.0

how?

michelle_paradero's picture
Offline
Joined: 11/10/2009
thanks but its not showing the right thing.

thanks but the operation <> only compares length of the string not the pattern. so it gives me the wrong results. the LIKE operation compares string through patterns NOT LIKE runs in VB6 but in VB.Net not and the syntax have change slightly. please help me on this. i've seen jaypabs use LIKE on one of his codes in the hotel management project. no i want to know the Opposite of LIKE.

i using crystal reports. I'm still new in vb.net. before the report loads i set the server name, database name, userid and passwrod of my connection to the database. its static not dynamic type. here hope this will help.

Dim myConnectionInfo As ConnectionInfo = New ConnectionInfo()
SetDBLogonForReport(myConnectionInfo)
myConnectionInfo.ServerName = "xxxxx"
myConnectionInfo.DatabaseName = "xxxxx"
myConnectionInfo.UserID = "xxxx"
myConnectionInfo.Password = "xxxx"

admin's picture
Offline
Joined: 11/14/2008
re: Help: MR ADMIN in syntax of NOT LIKE operator in VB.Net

Try this:

strWhere = "{qryInvent.SG} < 23 AND NOT {qryInvent.CurPosition} LIKE '*CM*'"

michelle_paradero's picture
Offline
Joined: 11/10/2009
=( still error

The error reads "A Boolean is required here". Please help mr. admin. i know u alone can help me with these.

michelle_paradero's picture
Offline
Joined: 11/10/2009
To: Mr. ADMIN

Still has error.

cedrick blas's picture
Offline
Joined: 09/13/2009
NOT LIKE

try this

something like NOT EQUAL

strWhere = "{qryInvent.SG} < 23 AND {qryInvent.CurPosition} <> '*CM*'"

Anonymous
to Mr. Admin

can you help me in system, can you please give me a sample System using crystal report in Visual basic 6.0..its the same thing as to an ID system..one of my system task is to print a marriage certificate,baptismal certificate and confirmation certificate..please, please, please. thank you..this is my email:rigormingo79@yahoo.com

Pages

Add new comment

Filtered HTML

  • You may insert videos with [video:URL]
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <asp>, <c>, <cpp>, <csharp>, <css>, <html4strict>, <java>, <javascript>, <mysql>, <php>, <python>, <sql>, <vb>, <vbnet>. The supported tag styles are: <foo>, [foo].
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.