<WebMethod()> _
Public Function viewpic(ByVal kyc As String) As clsloan
GetINI()
Dim dal As New DAL.DataAccess
Dim dr As MySqlDataReader
Dim cls As New clsloan
Try
dal.ConnectionString = ls_connectionString
dal.Provider = EnumProviders.MySQL
Dim str As String = "select kycno,afilename,picfile from nclattachments where kycno = '" & kyc & "'"
dr = dal.ExecReader(str, CommandType.Text)
While dr.Read
Dim lb As Byte() = CType(dr.Item("picfile"), Byte())
Dim filename As String = dr.Item("afilename")
cls.filename = filename
cls.picfile = lb
End While
Catch ex As Exception
MsgBox(ex.Message, "Error Message")
End Try
Return cls
End Function
I have this code above It works fine but it only return the last file.How could I access the first file to the last which will b placed in a listview im application.