Cannot find the method on the object instance
<p>I have an object called <code>Reservations</code>.  Inside <code>Reservations</code>, there is a another object called <code>Reservation</code> that is an array.</p>

<p>When I do something like the following:</p>

<pre><code>reservations.Reservation[i] = new Reservation(); //reservations if of type Reservations
</code></pre>

<p>I get the following error:</p>

<p><em>Cannot find the method on the object instance</em></p>

<p>A couple things I noticed is that when I get to this point, it throws an IndexOutOfRangeError and if I hover over the reservations variable, it shows a number.</p>

<p>VB Code</p>

<pre><code>Public Class Reservations
{
    Private RerservationField() as Reservation

    Public Property Reservation() as Reservation()
        Get
            Return Me.ReservationField
        End Get
        Set
            Me.ReservationId = value
        End Set
    End Property
}

Dim reservations As New Reservations()
ReDim reservations.Reservation(0)

Dim i as Integer = 0

reservations.Reservation(i) = New Reservation()
</code></pre>

<p>C# Code</p>

<pre><code>public class Reservations
{
    Reservation[] reservation {get;set;}
}

Reservations reservations = new Reservations();
reservations.Reservation = new Reservation[0];
int i = 0;
</code></pre>

<p>The VB Code and C# Code, it is instantiating the length of the array based on an xml request.  So in the vb code, it was doing this:</p>

<pre><code> ReDim reservations.Reservation(rq.Reservations.Reservation.Length - 1)
</code></pre>

<p>and in the c# code,  it was doing this:</p>

<pre><code>reservations.Reservation(rq.Reservations.Reservation.Length - 1).
</code></pre>

<p>Is the above my problem.  I need to do:</p>

<pre><code>reservations.Reservation(rq.Reservations.Reservation.Length)
</code></pre>

<p>rq is the request.</p>
