Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why isnt RowFilter working?

Status
Not open for further replies.

Draug

Programmer
Apr 18, 2001
77
0
0
CA
HELP!

I've been banging my head for hours on this. It seems that my dataview has no filter being applied after I've set the RowFilter property.

I have the following:

Dim daTransaction as DataAdapter
Dim dsTransaction as DataSet

'Fill Transaction table of dsTransaction
daTransaction.Fill(dsTransaction, "Transaction")

'Create and point the DataView
Dim dvSingleTransaction As DataView = New DataView(dsTransaction.Tables("Transaction"))

I've tried the following three ways to filter the data. None of them work, although none of them cause an exception. The Transaction Table does have the varChar column u_varBarCode in it. Why do none of these actually perform the filter?

dvSingleTransaction.RowFilter = "u_varBarCode = '0617'"

dvSingleTransaction.Table.DefaultView.RowFilter = "u_varBarCode = '0617'"

dsTransaction.Tables("Transaction").DefaultView.RowFilter = "u_varBarCode='" & FilterValue & "'"


Please, please let me know what stupid thing I am missing.

Thanks in advance.

 
I finally got it working, using the first of the three lines I was trying:
dvSingleTransaction.RowFilter = "u_varBarCode = '0617'"

I create that line by using:
dvSingleTransaction.RowFilter = "u_varBarCode ='" & FilterValue & "'"

FilterValue is a String that pulls its value from the same database column I am filtering on. I'm not sure why, but the line above works even though the first attempt didnt.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top