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

Daft question but how do I remove a filter from a datasource??

P: n/a
AAJ
I know this sounds nuts, but how do I remove the following filter from a
Object Datasource that looks at my business layer...

ODSDefaultUserProfiles.FilterExpression = "AllowedWebPage = '" +
m_SelectedPageName + "'";

I tried the obvious ones such as

ODSDefaultUserProfiles.FilterExpression = "";
forcing a select(), databind(); all to no avail

many thanks if anyone knows

Andy
Sep 28 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a

AAJ wrote:
I know this sounds nuts, but how do I remove the following filter from a
Object Datasource that looks at my business layer...

ODSDefaultUserProfiles.FilterExpression = "AllowedWebPage = '" +
m_SelectedPageName + "'";

I tried the obvious ones such as

ODSDefaultUserProfiles.FilterExpression = "";
forcing a select(), databind(); all to no avail

many thanks if anyone knows

Andy
I'm assuming ODSDefaultUserProfiles is your own class so it's difficult
to say how you'd remove the filter. In Ado.Net setting a filter string
to null will remove a filter, e.g.

DataTable table = new DataTable ();

// Add data to table.

DataView view = new DataView (table);

// Apply filter.
view.RowFilter = filterString;

// Cancel filter.
view.RowFilter = null;

Best,

Nick
http://seecharp.blogspot.com/

Sep 28 '06 #2

P: n/a
AAJ
Setting .FilterExpression = null; worked
obvious when you think about it, but not so obvious I thought about it !!!!
cheers Nick

Andy
"nick_nw" <ng****@gmail.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
>
AAJ wrote:
>I know this sounds nuts, but how do I remove the following filter from a
Object Datasource that looks at my business layer...

ODSDefaultUserProfiles.FilterExpression = "AllowedWebPage = '" +
m_SelectedPageName + "'";

I tried the obvious ones such as

ODSDefaultUserProfiles.FilterExpression = "";
forcing a select(), databind(); all to no avail

many thanks if anyone knows

Andy

I'm assuming ODSDefaultUserProfiles is your own class so it's difficult
to say how you'd remove the filter. In Ado.Net setting a filter string
to null will remove a filter, e.g.

DataTable table = new DataTable ();

// Add data to table.

DataView view = new DataView (table);

// Apply filter.
view.RowFilter = filterString;

// Cancel filter.
view.RowFilter = null;

Best,

Nick
http://seecharp.blogspot.com/

Sep 29 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.