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

RowFilter and stackoverflow

P: n/a
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
Share this Question
Share on Google+
5 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.