Click here to Skip to main content
13,593,025 members
Rate this:
 
Please Sign up or sign in to vote.
See more:
Well Im looking for some solution as I want to search database values(student_name,badge_id) with a single textbox and all the result will be shown in multiple fields like NAME, Roll No, Address.

Basically I will put the NAME or ROLLNO to search box and It will retrieve all the information related to that NAME or ROLLNO.

It it possible?

What I have tried:

DIM DV As New DataView(dbDataSet)
DV.RowFilter = String.Format("name Like '%{0}%'), search_text.Text)
student_name.Text.DataSource = DV
student_roll.text.DatSource = DV
Posted 19-Feb-18 8:58am
Updated 19-Feb-18 10:02am
v2
Comments
‭011111100010‬ 19-Feb-18 16:21pm
   
It would be easier to query sql directly,

SELECT * FROM table1 WHERE NAME LIKE '%%' OR ROLLNO LIKE "%%'

However, if you need to use the DataView just google how to put multiple filters on a DataView (I haven't used a DataView in many, many years).
Babai JermenKeller Sasmal 19-Feb-18 19:54pm
   
Thankyou sir for your help.

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

AS MSDN documentation states, you can use multiple statements:
Quote:
Operators
Concatenation is allowed using Boolean AND, OR, and NOT operators. You can use parentheses to group clauses and force precedence. The AND operator has precedence over other operators. For example:

(LastName = 'Smith' OR LastName = 'Jones') AND FirstName = 'John'


Source:
DataView.RowFilter Property (System.Data)[^]
DataColumn.Expression Property (System.Data)[^]
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Cookies | Terms of Service
Web03-2016 | 2.8.180618.1 | Last Updated 20 Feb 2018
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100