Hi guys need some guidance or help here.
i have DB that has first last and an picture.
I am trying to load the contents of the DB into a listbox on a desk top application. I can write and load the image with no problem to individual controls but having a h$$$ of a time figuring out how to make it work with a list box.
here is what i have please point me in write direction. ideally I would want the image to be sized at 42x42 but will take just being able to load multiple images.
sql = "select lastname, firstname, memberimage from t_member "
dim rs as RecordSet = APP.SDS.SQLSelect(sql)
if rs=Nil then
MsgBox" Unable to access "
if rs.RecordCount>0 then
while not rs.eof listbox1.AddRow(rs.Field("lastname").StringValue) listbox1.Cell(listbox1.LastIndex,1)=rs.Field("firstname").StringValue if rs.Field("memberimage") <> nil then //Dim b As BinaryStream //Dim f as FolderItem //f = SpecialFolder.Temporary.Child("temp.jpg") //b = BinaryStream.Create(f,true) //b.Write rs.Field("memberimage").NativeValue //b.Close //listbox1.rowimageat(3)=f.OpenasPicture listbox1.rowimageat(3)=noimage (i have this save to application still getting out of bounds errors.) //listbox1.cell(Canvas1.Backdrop = f.OpenAsPicture end if rs.MoveNext wend
MsgBox “No member found.”