B4J Question ArrayList cannot be cast

Peter Lewis

Well-Known Member
Licensed User
Longtime User
Hi,
I have been using this code for many programs and it was working in this program for the past 2 weeks. Now the program is spitting out an error on the last line of the code. Any Ideas ? Thank you


B4X:
    Dim query As String = $"
    Select [customer_id]
    ,[customer_contact_name]
    ,[customer_company_name]
    ,[customer_type]
    FROM [ledposter].[dbo].[customer_information]
    where customer_type = ?
    "$
    Dim dt As dataTable
    dt.Initialize(sql,query,Array As String("Owner"))
    Dim ownerinfo As List
    ownerinfo.Initialize

    For p = 0 To dt.RowsCount-1
        Dim game As Map = dt.getRowMapValues(p)
        ownerinfo.Add(game)
    Next
    Return ownerinfo

 

Peter Lewis

Well-Known Member
Licensed User
Longtime User
you are !00 % correct. I am however surprised it was working as a map


B4X:
    Dim custinfo As Map = loadinfo(sql,Main.customer_id)
    Dim ownerinfo As List = loadowner(sql)
    Dim mallinfo As List = loadmalltable(sql)
    Dim provinceinfo As List = loadprovincetable(sql)
    Dim municipalityinfo As List = loadmunicipalitytable(sql)
    Dim suburbinfo As List = loadsuburbtable(sql)

Now Changed
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…