Solved

Help with combining two like statements

Posted on 2011-02-10
2
259 Views
Last Modified: 2012-06-22
Hello,

I'm trying to combine to Like statements with the following code (VB.NET):

 Dim DVa As New DataView(dta, "Parent_Item like " & "'" & C1TrueDBGrid1.Columns(4).Value & "'" Or "Child_Item like  " & "'" & C1TrueDBGrid1.Columns(4).Value & "'", Nothing, DataViewRowState.CurrentRows)

But I'm getting the folowing error:

Conversion from string "Parent_Item like 'M107'" to type 'Long' is not valid.

Can you please help me fix thids problem. The code was working well until I added the second Like statement.

Thanks,

Victor
0
Comment
Question by:vcharles
2 Comments
 
LVL 23

Accepted Solution

by:
wdosanjos earned 500 total points
ID: 34867685
Please try the following:

  Dim DVa As New DataView(dta, "Parent_Item like '" & C1TrueDBGrid1.Columns(4).Value & "' Or Child_Item like '" & C1TrueDBGrid1.Columns(4).Value & "'", Nothing, DataViewRowState.CurrentRows)
0
 

Author Comment

by:vcharles
ID: 34867730
It worked.

Thank you very much.

Victor
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
sql help 8 55
SQL Query 26 64
Need help on t-sql 2012 10 54
Write to a printer using vb.net 9 27
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question