function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AhlomonAhlomon 

Data To DataGrid....Please advise

Instead of getting the values for two columns (Id and CreatedDate) I am getting only 1 column called “length” with the numbers of the length.
What I am doing wrong here??
 
========================================================
 
 
Private Function GetData() As Boolean
        Cursor = Cursors.WaitCursor
 
        Dim qr As sForce.QueryResult
        Dim queryString As String
 
        Dim list As System.Collections.ArrayList = New System.Collections.ArrayList
        queryString = "select Id, CreatedDate from TH_Revenue_Totals__c"
 
        Try
            qr = binding.query(queryString)
            If Not qr.records Is Nothing Then
                Dim i As Integer
 
                For i = 0 To qr.records.Length - 1
                    Dim rs As sForce.TH_Revenue_Totals__c
                    rs = qr.records(i)
 
                    list.Add(rs.Id.ToString)
                    list.Add(rs.CreatedDate.ToString)
 
                Next
                DataGrid1.DataSource = list
                GetData = True
            Else
                GetData = False
            End If
 
            Return GetData
        Catch ex As Exception
            lblStatus.Text = ex.Message
        Finally
            Cursor = Cursors.Default
        End Try
    End Function
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Call GetData()
 
    End Sub