Hallo2oo5
New member
Hi there,
I have a tough question here that I hope someone can answer.
Is there any way to filter a parent table based on a search done on its childtable.
I'd like to be able to return all parentrows whose childrows matched the search criteria
I tried to do this by searching the childtable and returning it's parentRow through its relation. I then saved the parentRow Primarykey in a string.(eg: "ClientCode = 'HALG01' OR ClientCode = 'MALH02'") I then set the parentTable’s bindingsource filter to equal the saved string.
The problem with this is if the search results go over a certain number, say 1000, the program throws up an error ('System.StackOverflowException' occurred in System.Data.dll) because of the lenght of the filter string
(example of filter string)
bs.Filter = "ClientCode = 'HALG01' OR ClientCode = 'MALH02' OR ClientCode = 'HALG01' OR ClientCode = 'GERH02' OR ClientCode = 'BOPD01' OR ClientCode = 'RORJ02' etc..."
So does anybody know how to do this
Thanks Ger
I have a tough question here that I hope someone can answer.
Is there any way to filter a parent table based on a search done on its childtable.
I'd like to be able to return all parentrows whose childrows matched the search criteria
I tried to do this by searching the childtable and returning it's parentRow through its relation. I then saved the parentRow Primarykey in a string.(eg: "ClientCode = 'HALG01' OR ClientCode = 'MALH02'") I then set the parentTable’s bindingsource filter to equal the saved string.
The problem with this is if the search results go over a certain number, say 1000, the program throws up an error ('System.StackOverflowException' occurred in System.Data.dll) because of the lenght of the filter string
(example of filter string)
bs.Filter = "ClientCode = 'HALG01' OR ClientCode = 'MALH02' OR ClientCode = 'HALG01' OR ClientCode = 'GERH02' OR ClientCode = 'BOPD01' OR ClientCode = 'RORJ02' etc..."
So does anybody know how to do this
Thanks Ger