It sounds to me like it's a data issue. If it's certain values where that's occuring every time, it has to be something with the data. Have you verified the records in the database? I'd look for multiple records in the ID column for the Parent where ID = x and then for records where the parentID = x and see what you come up with.
You should look at the ID values of the children and review those record values. (this might not be a concern, but having had to work with FoxPro in the past...) If the records are good, I'd ask you what database you're using. I'm guessing it's SQL Server, but if you use something like FoxPro databases it will pull deleted records if the database table hasn't been packed because the records are not actually deleted, but merely marked they are deleted. On Mar 14, 10:03 am, S <[email protected]> wrote: > Hello all -- I am facing a weird problem with my object that I create > at application start up. This object holds the data from the database > which is referenced throughout the application. > > So the table contents following structure > > ID , ParentID , Name, Value > > First few values form the root of the structure. In my logic first I > create the root nodes and then with another query I get all the values > which are not the root and using the root values I create a list from > the non-root nodes. > > For a specific root values deep in the tree I have 5 values but only 2 > are fetched from that list. I have tested in other parts of the code > to see if only 2 values are returned for that node but it returns the > correct number (just for the test and not used anywhere). This issue > occurs only when I am actually building the tree. I fail to understand > why only for a specific value it returns incorrect number of children. > > Any thoughts ? > > var getChildren = (from mL in masterList > where mL.ParentID == parent.ID > orderby mL.ID > select new Category() > { > ID = mL.ID, > Name = mL.Name, > ParentID = mL.ParentID, > Parent = parent, > Level = parent.Level + > 1 , > Value = mL.Value, > ETFCount = mL.ETFCount > } > ).ToList(); > > Above is the code that is used to create the tree (this is a part of > recursive code in the function). -- You received this message because you are subscribed to the Google Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/dotnetdevelopment?hl=en?hl=en or visit the group website at http://megasolutions.net
