Schema Dataview does not respond to RowFilters?
Schema Dataview does not respond to RowFilters?
Schema Dataview does not respond to RowFilters?
Schema Dataview does not respond to RowFilters?
Schema Dataview does not respond to RowFilters?
Schema Dataview does not respond to RowFilters? Schema Dataview does not respond to RowFilters? Schema Dataview does not respond to RowFilters? Schema Dataview does not respond to RowFilters? Schema Dataview does not respond to RowFilters? Schema Dataview does not respond to RowFilters? Schema Dataview does not respond to RowFilters? Schema Dataview does not respond to RowFilters?
Schema Dataview does not respond to RowFilters? Schema Dataview does not respond to RowFilters?
Schema Dataview does not respond to RowFilters?
Go Back  Xtreme Visual Basic Talk > > > Schema Dataview does not respond to RowFilters?


Reply
 
Thread Tools Display Modes
  #1  
Old 04-08-2013, 07:39 PM
Gruff's Avatar
GruffSchema Dataview does not respond to RowFilters? Gruff is offline
Bald Mountain Survivor

Retired Moderator
* Expert *
 
Join Date: Aug 2003
Location: Oregon, USA - deceased
Posts: 6,440
Default Schema Dataview does not respond to RowFilters?


I have a small app I am recreating in VB.NET that allows me to puruse a provideX database.

Being that it is now written in VB.NET I thought I could add some improvements, the first of which is a filter for the database table names.

I used Open.GetSchema() to retrieve the list of table names.
This works as it should and returns a recordset that contains among other fields one named "TABLE_NAME". I attach the recordset to a listbox

And presto. The listbox contains my table names.
Looks good however now when I try to use RowFilter and RowFilterState
on the DataView the listbox displays zip.

I've used RowFilters on other projects and it always worked until now.
Would the GetSchema be returning a recordset that does not have all the
functionality a standard recordset should have?

Kinda stumped here. :/

Code:
Public Class clsMasDB Public Function GetMasSchema() As DataView Dim DT As DataTable Dim DV1 As DataView Dim Conn As Odbc.OdbcConnection = New Odbc.OdbcConnection(g_MAS200_Connection_Str) Conn.ConnectionTimeout = 15 DT = New DataTable Conn.Open() DT = Conn.GetSchema(OdbcMetaDataCollectionNames.Tables) DT.TableName = "MAS_Tables" DV1 = DT.DefaultView DT.Dispose() Conn.Close() Conn.Dispose() Return DV1 DV1.Dispose() End Function End Class Public Class Form1 Private Sub Form_Load... Dim oMas As New clsMASDB oDV_Tables = oMas.GetMasSchema lstTables.DataSource = oDV_Tables lstTables.DisplayMember = "TABLE_NAME" 'listbox lists table names '(AP_Audit is listed.) ... End Sub Private Sub Button1_Click ' Test Filter Dim sQuery as string = "TABLE_NAME = 'AP_Audit'" With oDV_Tables .RowStateFilter = DataViewRowState.None .RowFilter = sQuery .RowStateFilter = DataViewRowState.ModifiedCurrent ' Listbox shows nothing End With End Sub End Class
__________________
Burn the land and boil the sea
You can't take the sky from me


~T
Reply With Quote
  #2  
Old 04-09-2013, 07:53 AM
DrPunk's Avatar
DrPunkSchema Dataview does not respond to RowFilters? DrPunk is offline
Senior Contributor

* Expert *
 
Join Date: Apr 2003
Location: Never where I want to be
Posts: 1,403
Default

Your disposing of objects confuses me. I'm not sure if that's having an effect.

Why not just use the DefaultView of the DataTable rather than assigning it to a variable? Have GetMasSchema return a DataTable and then refer to that's DefaultView property to change what is displayed.
__________________
There are no computers in heaven!
Reply With Quote
  #3  
Old 04-09-2013, 10:06 AM
Gruff's Avatar
GruffSchema Dataview does not respond to RowFilters? Gruff is offline
Bald Mountain Survivor

Retired Moderator
* Expert *
 
Join Date: Aug 2003
Location: Oregon, USA - deceased
Posts: 6,440
Default

Okay, I'll give it a try. What I find is that when I need a dataview I need it everywhere.
It seemed proper to use a dataview as the returned object. In fact I've been doing this for several years. No problems with anything else I've written. Are DataViews heavier than DataTables?

The listbox displays the unfiltered data perfectly.

Made the changes you suggested. Initial data still shows up.
Still no RowFilter results.

Could the underscores in the data be an issue?
__________________
Burn the land and boil the sea
You can't take the sky from me


~T
Reply With Quote
  #4  
Old 04-09-2013, 10:19 AM
DrPunk's Avatar
DrPunkSchema Dataview does not respond to RowFilters? DrPunk is offline
Senior Contributor

* Expert *
 
Join Date: Apr 2003
Location: Never where I want to be
Posts: 1,403
Default

Quote:
Originally Posted by Gruff View Post
Are DataViews heavier than DataTables?
Dunno. Doubt it. Was just something to try.
Quote:
Could the underscores in the data be an issue?
I don't think so. I've just tried a dataview with fields with underscores in and it seems to work OK.
__________________
There are no computers in heaven!
Reply With Quote
  #5  
Old 04-09-2013, 07:21 PM
Gruff's Avatar
GruffSchema Dataview does not respond to RowFilters? Gruff is offline
Bald Mountain Survivor

Retired Moderator
* Expert *
 
Join Date: Aug 2003
Location: Oregon, USA - deceased
Posts: 6,440
Default

Well I still do not know what the problem with the code is.
As I stated previously I've used this feature before. Exactly as shown.

Found a work around... with this table I cannot set the RowFilterState.
Removing all lines that use the RowFilterState allows this dataview to work.

Weird B/

The only difference I can see is that this Dataview was generated with GetSchema.

Thanks for the sanity check.
__________________
Burn the land and boil the sea
You can't take the sky from me


~T
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Schema Dataview does not respond to RowFilters?
Schema Dataview does not respond to RowFilters?
Schema Dataview does not respond to RowFilters? Schema Dataview does not respond to RowFilters?
Schema Dataview does not respond to RowFilters?
Schema Dataview does not respond to RowFilters?
Schema Dataview does not respond to RowFilters? Schema Dataview does not respond to RowFilters? Schema Dataview does not respond to RowFilters? Schema Dataview does not respond to RowFilters? Schema Dataview does not respond to RowFilters? Schema Dataview does not respond to RowFilters? Schema Dataview does not respond to RowFilters?
Schema Dataview does not respond to RowFilters?
Schema Dataview does not respond to RowFilters?
 
Schema Dataview does not respond to RowFilters?
Schema Dataview does not respond to RowFilters?
 
-->