By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,641 Members | 1,446 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,641 IT Pros & Developers. It's quick & easy.

Dataview Rowfilter

P: n/a
Hi Ng,

need some help here. What's wrong with that dataview.rowfilter expression:
dtFliste.DefaultView.RowFilter = "Field1 Like '%" & strFV & "%'" & _
" AND Field2 Like '%" & strFS & "%'" & _
" AND Field3 Like '%" & strFT & "%'" & _
" AND Field4 Like '%" & strGW & "%'" & _
" AND Field5 Like '%" & strKu & "%'" & _
" AND Field6 Like '%" & strIb & "%'"

As this filter always returns an empty datatable?

Thanks a Lot.

G. Schmelzer


Nov 21 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
"Georg Schmelzer" <as**@adsf.de> wrote in message
news:eF*************@TK2MSFTNGP12.phx.gbl...
Hi Ng,

need some help here. What's wrong with that dataview.rowfilter expression:
dtFliste.DefaultView.RowFilter = "Field1 Like '%" & strFV & "%'" & _
" AND Field2 Like '%" & strFS & "%'" & _
" AND Field3 Like '%" & strFT & "%'" & _
" AND Field4 Like '%" & strGW & "%'" & _
" AND Field5 Like '%" & strKu & "%'" & _
" AND Field6 Like '%" & strIb & "%'"

As this filter always returns an empty datatable?

Thanks a Lot.

G. Schmelzer

Do any of your str* fields have leading or trailing blanks which may cause
no records to be selected?

--
Jonathan Bailey.
Nov 21 '05 #2

P: n/a
Georg,
In addition to the other comments:

You are using AND, which means that all the conditions HAVE to be True!

Are you certain that ALL the conditions are true?

For example if you only match on Field1, do you get records?

Also can you use Debug.WriteLine to print out the RowFilter after you set
it? As that would show us what the RowFilter itself looks like (it would
help identify badly formed filters). Can you post what RowFilter contains
after you set it if its now obvious to you what the problem is.

Hope this helps
Jay

"Georg Schmelzer" <as**@adsf.de> wrote in message
news:eF*************@TK2MSFTNGP12.phx.gbl...
Hi Ng,

need some help here. What's wrong with that dataview.rowfilter expression:
dtFliste.DefaultView.RowFilter = "Field1 Like '%" & strFV & "%'" & _
" AND Field2 Like '%" & strFS & "%'" & _
" AND Field3 Like '%" & strFT & "%'" & _
" AND Field4 Like '%" & strGW & "%'" & _
" AND Field5 Like '%" & strKu & "%'" & _
" AND Field6 Like '%" & strIb & "%'"

As this filter always returns an empty datatable?

Thanks a Lot.

G. Schmelzer


Nov 21 '05 #3

P: n/a
Hi,

I solved the Problem myself. I just took a stringbuilder and build a string
which contains only those parts of the filter that aren't empty.

But thank you anyway.
mfg G. Schmelzer
"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> schrieb im
Newsbeitrag news:uk*************@TK2MSFTNGP09.phx.gbl...
Georg,
In addition to the other comments:

You are using AND, which means that all the conditions HAVE to be True!

Are you certain that ALL the conditions are true?

For example if you only match on Field1, do you get records?

Also can you use Debug.WriteLine to print out the RowFilter after you set
it? As that would show us what the RowFilter itself looks like (it would
help identify badly formed filters). Can you post what RowFilter contains
after you set it if its now obvious to you what the problem is.

Hope this helps
Jay

"Georg Schmelzer" <as**@adsf.de> wrote in message
news:eF*************@TK2MSFTNGP12.phx.gbl...
Hi Ng,

need some help here. What's wrong with that dataview.rowfilter expression:

dtFliste.DefaultView.RowFilter = "Field1 Like '%" & strFV & "%'" & _
" AND Field2 Like '%" & strFS & "%'" & _
" AND Field3 Like '%" & strFT & "%'" & _
" AND Field4 Like '%" & strGW & "%'" & _
" AND Field5 Like '%" & strKu & "%'" & _
" AND Field6 Like '%" & strIb & "%'"

As this filter always returns an empty datatable?

Thanks a Lot.

G. Schmelzer



Nov 21 '05 #4

P: n/a
George,
Glad you got it to work...

I was actually concerned that it was the "parts you didn't need" that was
messing you up.

Thanks for letting us know.
Jay

"Georg Schmelzer" <as**@adsf.de> wrote in message
news:um**************@TK2MSFTNGP12.phx.gbl...
Hi,

I solved the Problem myself. I just took a stringbuilder and build a string which contains only those parts of the filter that aren't empty.

But thank you anyway.
mfg G. Schmelzer
"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> schrieb im
Newsbeitrag news:uk*************@TK2MSFTNGP09.phx.gbl...
Georg,
In addition to the other comments:

You are using AND, which means that all the conditions HAVE to be True!

Are you certain that ALL the conditions are true?

For example if you only match on Field1, do you get records?

Also can you use Debug.WriteLine to print out the RowFilter after you set
it? As that would show us what the RowFilter itself looks like (it would
help identify badly formed filters). Can you post what RowFilter contains after you set it if its now obvious to you what the problem is.

Hope this helps
Jay

"Georg Schmelzer" <as**@adsf.de> wrote in message
news:eF*************@TK2MSFTNGP12.phx.gbl...
Hi Ng,

need some help here. What's wrong with that dataview.rowfilter

expression:

dtFliste.DefaultView.RowFilter = "Field1 Like '%" & strFV & "%'" & _
" AND Field2 Like '%" & strFS & "%'" & _
" AND Field3 Like '%" & strFT & "%'" & _
" AND Field4 Like '%" & strGW & "%'" & _
" AND Field5 Like '%" & strKu & "%'" & _
" AND Field6 Like '%" & strIb & "%'"

As this filter always returns an empty datatable?

Thanks a Lot.

G. Schmelzer




Nov 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.