views:

25

answers:

1

I'm trying to make a calendar in vb.net and I have come across this problem. I want to append some text into an existing datatable row. When I watch my debugger it says:"In order to evaluate an indexed property, the property must be qualified and the arguments must be explicitly supplied by the user.".

 Dim aantalRijen As Integer = 1

    For x = 0 To 6
        Dim dttopdrachten As New DataTable
        dttopdrachten = opdrachtendao.getOpdrachtenByDate(Today.AddDays(x))
        If dttopdrachten.Rows.Count > aantalRijen Then
            aantalRijen = dttopdrachten.Rows.Count
        End If
    Next

    For z = 0 To aantalRijen - 1

        Dim r As DataRow
        r = dttAgenda.NewRow()
        dttAgenda.Rows.InsertAt(r, z)

    Next

    For i = 0 To 6

        Dim aantalItems As Integer = 0
        Dim dttopdrachten As New DataTable
        dttopdrachten = opdrachtendao.getOpdrachtenByDate(Today.AddDays(i))
        aantalItems = dttopdrachten.Rows.Count

        For j = 0 To aantalItems - 1

            Dim info As String = dttopdrachten.Rows(j).Item(0).ToString & vbCrLf & dttopdrachten.Rows(j).Item(2).ToString & vbCrLf & dttopdrachten.Rows(j).Item(3).ToString & vbCrLf & dttopdrachten.Rows(j).Item(4).ToString & vbCrLf & dttopdrachten.Rows(j).Item(5).ToString & vbCrLf & dttopdrachten.Rows(j).Item(6).ToString
            dttAgenda.Rows(j).Item(i) = info

        Next

    Next

    dgvAgenda.DataSource = dttAgenda

In the code above, I first count how many rows I have to make. Afterwards I add the amount of rows to the datatable (columns are added before). Until here it works, but then when I keep debugging I get the error. I tried googling but nothing could help me so far.

I hope someone can help me here.

A: 

Seem problem has been solved without changing anything. So if someone want to make a calendar. Here's the solution ;)

Tim Decuypere