Hi,
I have looked around for a solution to my problem with no results. My issue
is that I cannot bind an arraylist to a datagrid control in asp.net.
My code snippet:
For Each ........
.........
.........
While dbread.Read()
MyArrayList.add(dbread("iHawb"))
MyArrayList.add(dbread("iDate"))
MyArrayList.add(dbread("iTime"))
MyArrayList.add(dbread("iStatus"))
MyArrayList.TrimToSize()
End While
Next
datagrid1.DataSource = MyArrayList
datagrid1.DataBind()
The error message:
A field or property with the name 'iHawb' was
not found on the selected data
source.
The error is because binding to a datagrid requires iList. A Radio Button,
Drop Down List, etc can be bound but not a Datagrid,Datalist or a
Datarepeater.
Kind Regards
Farook
|