|
-
Dec 28th, 2002, 10:20 PM
#1
Thread Starter
Hyperactive Member
RowFilter
I am trying to filter my record base on Employee No. like this;
Dim aFind As String
aFind = InputBox("Enter a Employee No.", "Search for Employee No.")
Dim dv As DataView = DataSet11.Employee.DefaultView
dv.RowFilter = "empno='" & aFind & "'"
But it has no reaction and it not working. Kindly teach me the correct syntax of RowFilter?
-
Dec 29th, 2002, 02:20 AM
#2
VB Code:
Dim aFind As String= InputBox("Enter a Employee No.", "Search for Employee No.")
Dim filteredRows() As DataRow = DataSet11.Employee.Select("empno='" & aFind & "'")
'now filteredRows contains any rows that match the critieria
-
Dec 29th, 2002, 09:12 AM
#3
Frenzied Member
Omit those ' from your filter string when you are filtering on numbers not text. So your code is correct except it should be like this:
VB Code:
dv.RowFilter = "empno=" & aFind
-
Feb 5th, 2003, 11:33 AM
#4
Lively Member
I dont get it where to you use the filteredrows() at then?
-
Feb 5th, 2003, 11:42 AM
#5
Frenzied Member
in the above example filteredrows() is an array of DataRows containing the desired criteria.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|