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

  • Thread starter Thread starter AAJ
  • Start date Start date
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
 
AAJ said:
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/
 
Setting .FilterExpression = null; worked


obvious when you think about it, but not so obvious I thought about it !!!!


cheers Nick

Andy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top