473,396 Members | 2,014 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

RowFilter and stackoverflow

Is there a limit to how big a rowfilter on dataview could be? my rowfilter is dynamically generated and if its get too big I get a stackoverflow error other wise it works fine.
Any direction is appreciated it.

Nov 21 '05 #1
5 4884
Gene,

Show some code because this sounds weird, a dataview is not that big in my
opinion it is only to hold the reverences to the rows.

Cor
Nov 21 '05 #2
Correction, I see what you mean now, you make a rowfilter like this.

Dim myrowfilter as string = "Name = 'Jan' Or "
For myname as string in mytable
string = string '" & mylname & "'"
next
'remove the last Or

When it is this and blows up your program because a stack overflow I would
not even look how big the stack could be however take another approach.

However just my opinion.

Cor
Nov 21 '05 #3
Thanks everyone for the reply.

What I am doing is for example trying to filter a dataset for certain first
name and last names.

So I create a dataview and filter the dataview

When I filter for forty combination it works perfectly but when It gets to
hundreds I get an error.

"Cor Ligthert" <no**********@planet.nl> wrote in message
news:OU*************@TK2MSFTNGP11.phx.gbl...
Correction, I see what you mean now, you make a rowfilter like this.

Dim myrowfilter as string = "Name = 'Jan' Or "
For myname as string in mytable
string = string '" & mylname & "'"
next
'remove the last Or

When it is this and blows up your program because a stack overflow I would
not even look how big the stack could be however take another approach.

However just my opinion.

Cor

Nov 21 '05 #4
Gene,
It sounds like either a badly formed expression or too complex an
expression.

Although I don't know if the limits of the Expression is documented, I have
seen limits. One way to avoid these limits is to pick a "Better" operator.

For example, use the In operator instead of = if you are comparing a single
field to a list of values.

Use:

Dim view As DataView
view.RowFilter = "FirstName In ('Jay', 'Cor', 'Herfried', 'Gene')

Instead of:

Dim view As DataView
view.RowFilter = "FirstName = 'Jay' Or FirstName = 'Cor' Or FirstName =
'Herfried' Or FirstName = 'Gene')

Of course if you want to match both names, then this may not work as well. I
would consider letting your database do the selection in this case.

For information on expressions, such as DataView.RowFilter, in the DataSet
object model see the DataColumn.Expression help topic.

http://msdn.microsoft.com/library/de...ssiontopic.asp

Hope this helps
Jay
Hope this helps
Jay

"Gene Ariani" <ka*****@comcast.net> wrote in message
news:kJ********************@comcast.com...
Thanks everyone for the reply.

What I am doing is for example trying to filter a dataset for certain first name and last names.

So I create a dataview and filter the dataview

When I filter for forty combination it works perfectly but when It gets to
hundreds I get an error.

"Cor Ligthert" <no**********@planet.nl> wrote in message
news:OU*************@TK2MSFTNGP11.phx.gbl...
Correction, I see what you mean now, you make a rowfilter like this.

Dim myrowfilter as string = "Name = 'Jan' Or "
For myname as string in mytable
string = string '" & mylname & "'"
next
'remove the last Or

When it is this and blows up your program because a stack overflow I would not even look how big the stack could be however take another approach.

However just my opinion.

Cor


Nov 21 '05 #5
Jay;

Your solution has worked on single filed liked a charm where it used to give
me stackoverflow.

I will look to see if I can adopt for two fields.
thanks

gene
"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:u6**************@TK2MSFTNGP10.phx.gbl...
Gene,
It sounds like either a badly formed expression or too complex an
expression.

Although I don't know if the limits of the Expression is documented, I have seen limits. One way to avoid these limits is to pick a "Better" operator.

For example, use the In operator instead of = if you are comparing a single field to a list of values.

Use:

Dim view As DataView
view.RowFilter = "FirstName In ('Jay', 'Cor', 'Herfried', 'Gene')

Instead of:

Dim view As DataView
view.RowFilter = "FirstName = 'Jay' Or FirstName = 'Cor' Or FirstName = 'Herfried' Or FirstName = 'Gene')

Of course if you want to match both names, then this may not work as well. I would consider letting your database do the selection in this case.

For information on expressions, such as DataView.RowFilter, in the DataSet
object model see the DataColumn.Expression help topic.

http://msdn.microsoft.com/library/de...ssiontopic.asp
Hope this helps
Jay
Hope this helps
Jay

"Gene Ariani" <ka*****@comcast.net> wrote in message
news:kJ********************@comcast.com...
Thanks everyone for the reply.

What I am doing is for example trying to filter a dataset for certain

first
name and last names.

So I create a dataview and filter the dataview

When I filter for forty combination it works perfectly but when It gets to
hundreds I get an error.

"Cor Ligthert" <no**********@planet.nl> wrote in message
news:OU*************@TK2MSFTNGP11.phx.gbl...
Correction, I see what you mean now, you make a rowfilter like this.

Dim myrowfilter as string = "Name = 'Jan' Or "
For myname as string in mytable
string = string '" & mylname & "'"
next
'remove the last Or

When it is this and blows up your program because a stack overflow I

would not even look how big the stack could be however take another approach.
However just my opinion.

Cor



Nov 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: vbnetrookie | last post by:
In the dataview rowfilter property, how can I say that I just want Titles that start with 'A' to 'J' ?? ex: dv.rowfilter = " Country = ' France ' " I want dv.rowfilter = " Title = (from...
2
by: Ryan Moore | last post by:
I have a dataset (called adset) which has a column called "Large" which is either an integer 0 or 1. I am creating 2 dataviews, one which should display the 1's and one which should display the...
8
by: Dave Hagerich | last post by:
I'm using a DataGrid with a DataSet and I'm trying to filter the data being displayed, using the following code as a test: DataView theView = new DataView(theDataSet.Tables); theView.RowFilter =...
9
by: Marty McFly | last post by:
Greetings, I'm trying to let my users dynamically filter records from a table that relate to other tables. RELATIONSHIPS: . = . . = . There is a Many-to-Many relationship between...
8
by: KC | last post by:
For a DataView.Rowfilter can I use more than one expression? I want to filter out two different things. For example can I take: dv.RowFilter = "MTX <> 'Customer Forcast'" and ...
0
by: neeraj | last post by:
Hi, all Could anny one give me help how can I use like operator with these data types "integer , datetime or boolean" in DataView.RowFilter Actually when I try to get the data from dataview...
2
by: neeraj | last post by:
Hi, all Could anny one give me help how can I use like operator with these data types "integer , datetime or boolean" in DataView.RowFilter Actually when I try to get the data from dataview...
1
by: AlexW | last post by:
Hi I am in the process of developing an inventory application in visual basic. I keep coming up against a problem with using the dataview.rowfilter property. Basically what happens is this: -a...
5
by: AlexW | last post by:
Hi I am in the process of developing an inventory application in visual basic. I keep coming up against a problem with using the dataview.rowfilter property. Basically what happens is this: -a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.