dripaltace
New Member
Starters: Here is the error that gets generated:Destination array was not long enough. Check destIndex and length, and the array's lower bounds.Code: C#, ASP.NETEnv: VS 2005What I'm doing is using a BitArray to flip bits based on a certain condition of a TreeView. Right now I'm traversing a TreeView and if the node is checked from a child, I will flip an index in the BitArray. I have multiple TreeViews that I am traversing so I have multiple BitArrays. Once I get all the BitArrays populated, I will convert the bits to an integer value (encoded in a sense) and place them in an int array. Then the ultimate goal is to push the integer values to a database but obviously I can't get that far. Sample code provided below:\[code\] BitArray MTRTECH = new BitArray(8); BitArray MTRRD = new BitArray(200); BitArray REVSE = new BitArray(100); BitArray ETXA = new BitArray(100); int[] conversion = new int[11]; ParentChildCheck(MTRTECHTreeView, MTRTECH); MTRTECH.CopyTo(conversion, 7); ParentChildCheck(MTRRDRTreeView, MTRRD); MTRRD.CopyTo(conversion, 8); <================ Throws Error Here ParentChildCheck(REVSECTreeView, REVSE); REVSE.CopyTo(conversion, 9); ParentChildCheck(EXTRATreeView, ETXA); ETXA.CopyTo(conversion, 10); protected void ParentChildCheck(TreeView parent, BitArray Changes) { TreeNode temp = new TreeNode(); for (int index = 0; index < parent.Nodes.Count; index++) { temp = parent.Nodes[index]; for (int index2 = 0; index2 < temp.ChildNodes.Count; index2++) { ChildCheck(temp.ChildNodes[index2],Changes,index2); } } } protected void ChildCheck(TreeNode node, BitArray Selection, int value) { message2 += node.Text; Selection.Set(value, true); counter++; for (int index = 0; index < node.ChildNodes.Count; index++) { value++; ChildCheck(node.ChildNodes[index],Selection,value); } }\[/code\]