471,344 Members | 984 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,344 software developers and data experts.

RowFilter of Dataview object ???

Dear all,

I am using a dataview windows application object
Form that I need to set the RowFilter property in order to view data based
on two different columns values.

Querry string is as follow :

m_sSeverityFilter = m_dsHist.Tables(0).Columns(4).ColumnName & " = " & "'" &
cbSeverity.Text & "'"

m_sCommentFilter = m_dsHist.Tables(0).Columns(6).ColumnName & " <>''" (need
to filter here column fileds which are not null or empty string)

Base on that it works fine as long as I work only one of those criteria but
as soon as I used both condions I get a sythax error that I could not pointed
out why

DataView.RowFilter =m_sCommentFilter & "," & m_sCommentFilter

ANy ideas where is the error?

thnaks for your help
regards
serge
Jul 21 '05 #1
2 1748
You can test for null conditions using the following
http://www.knowdotnet.com/articles/a...rowfilter.html

and you can test for multiple conditiions using AND. IF it's blowing up you
probably just have an extra ' somewhere

--
W.G. Ryan, MVP

www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"serge calderara" <se************@discussions.microsoft.com> wrote in
message news:32**********************************@microsof t.com...
Dear all,

I am using a dataview windows application object
Form that I need to set the RowFilter property in order to view data based
on two different columns values.

Querry string is as follow :

m_sSeverityFilter = m_dsHist.Tables(0).Columns(4).ColumnName & " = " & "'" & cbSeverity.Text & "'"

m_sCommentFilter = m_dsHist.Tables(0).Columns(6).ColumnName & " <>''" (need to filter here column fileds which are not null or empty string)

Base on that it works fine as long as I work only one of those criteria but as soon as I used both condions I get a sythax error that I could not pointed out why

DataView.RowFilter =m_sCommentFilter & "," & m_sCommentFilter

ANy ideas where is the error?

thnaks for your help
regards
serge

Jul 21 '05 #2
Serge,

As Bill told do you have to use the AND (and not the &).
As well is this filter one continuous string and not two strings.

I hope this helps,

Cor
Jul 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by vbnetrookie | last post: by
2 posts views Thread by Ryan Moore | last post: by
8 posts views Thread by Dave Hagerich | last post: by
8 posts views Thread by KC | last post: by
5 posts views Thread by Gene Ariani | last post: by
reply views Thread by Ronak mishra | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.