Dataview RowFilter efficiency problem
-
Hello all I was wondering if anyone out there knows of a way to filter out rows based on a condition that is more efficient than the dataview.rowfilter?
Public Sub filterDataSource(ByVal filter As String) Dim tempSelectedValue As Object If IsNothing(Me.SelectedValue) = True Then tempSelectedValue = "-1" Else tempSelectedValue = Me.SelectedValue End If Me.mDataViewCombo.RowFilter = filter Try Me.SelectedValue = tempSelectedValue Catch ex As Exception End Try End Sub
The "Me.mDataViewCombo.RowFilter = filter" takes about 2 seconds to complete when there are about 700 rows and I was wondering if there was any other way to improve upon that. I have tried to "Me.mDataViewCombo.table.select(filter)", but this method does not seem to filter anything at all. Thank you. eatwork -
Hello all I was wondering if anyone out there knows of a way to filter out rows based on a condition that is more efficient than the dataview.rowfilter?
Public Sub filterDataSource(ByVal filter As String) Dim tempSelectedValue As Object If IsNothing(Me.SelectedValue) = True Then tempSelectedValue = "-1" Else tempSelectedValue = Me.SelectedValue End If Me.mDataViewCombo.RowFilter = filter Try Me.SelectedValue = tempSelectedValue Catch ex As Exception End Try End Sub
The "Me.mDataViewCombo.RowFilter = filter" takes about 2 seconds to complete when there are about 700 rows and I was wondering if there was any other way to improve upon that. I have tried to "Me.mDataViewCombo.table.select(filter)", but this method does not seem to filter anything at all. Thank you. eatworkThe Select function returns an array of DataRow objects. Thus the DataView isn't affected. There is no real way to improve the RowFilter performance generally. But if I recall right you might get better results if you sort the DataView by the column you are filtering (if it is a simple expression with only one column) because it then uses some kind of internal index.
-
The Select function returns an array of DataRow objects. Thus the DataView isn't affected. There is no real way to improve the RowFilter performance generally. But if I recall right you might get better results if you sort the DataView by the column you are filtering (if it is a simple expression with only one column) because it then uses some kind of internal index.
-
Hello all I was wondering if anyone out there knows of a way to filter out rows based on a condition that is more efficient than the dataview.rowfilter?
Public Sub filterDataSource(ByVal filter As String) Dim tempSelectedValue As Object If IsNothing(Me.SelectedValue) = True Then tempSelectedValue = "-1" Else tempSelectedValue = Me.SelectedValue End If Me.mDataViewCombo.RowFilter = filter Try Me.SelectedValue = tempSelectedValue Catch ex As Exception End Try End Sub
The "Me.mDataViewCombo.RowFilter = filter" takes about 2 seconds to complete when there are about 700 rows and I was wondering if there was any other way to improve upon that. I have tried to "Me.mDataViewCombo.table.select(filter)", but this method does not seem to filter anything at all. Thank you. eatworkThe only way to improve upon this is to not have 700 rows in your DataSet. You could requery the database for the smaller rowset, but that involves bugging the SQL Server again and transferring that data over the network again. Dave Kreskowiak Microsoft MVP - Visual Basic