none
I am getting this error at "get => (JaggedData)jaggeddatas[index];". Please direct me to the right direction towards the solution. RRS feed

  • Question

  • lass JaggedDataCollection
        {
            ArrayList jaggeddatas = new ArrayList();
    
            public JaggedData this[int index]
            {
                get => (JaggedData)jaggeddatas[index];
                set => jaggeddatas.Insert(index, value);
            }
        }
    
    public class NumberWithDifference
    {
        public int Number { get; set; }
        public static int[] decimalNumbers = new int[10]{0,1,2,3,4,5,6,7,8,9};
        JaggedDataCollection jdc = new JaggedDataCollection();
    
    foreach (var item in jagged.Items)
        {
            int index = 0;
            bool i = true;
                                int index = 0;
    
                                for (int j = 0; j < decimalNumbers.Length; j++)
    
                                {
                                if (jdc[index].Number == decimalNumbers[j])
                                    {
                                        Console.Write(decimalNumbers[j]);
                                        i = false;
                                        if (index < decimalNumbers.Length - 1)
                                            index++;
                                    }
                                    else
                                    {
                                        Console.Write(0);
                                    }
                                }
        }
    }
    Tuesday, September 10, 2019 12:43 AM

All replies

  • Hi Akhil963,

    Thank you for posting here.

    For your question, I want to know two things.

    First, could you provide the code about JaggedData?

    Second, what exception or error you got?

    Best Regards,

    Jack


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, September 10, 2019 5:27 AM
    Moderator