Before telling you the problem, excuse me for my bad english, I only know the basicI have a function with a query and I want to return it, I was doing this:\[code\]Public Function obtenerDataAjuste(ByVal id As Integer) Dim ajuste As New Ajuste Dim cmd as New SqlCommand("usp_obtenerDataAjuste",cn.getCN") cmd.CommandType = CommandType.StoredProcedure cn.getCN().Open() Dim dr as SqlDataReader dr = cmd.ExecuteReader Dim ajustelist As New List(Of Ajuste) While dr.Read ajuste.pesomix = dr("PesoMix") ajuste.pesoprod = dr("PesoProd") ajuste.unidad = dr("UNIDAD_EMPAQUE") End While cn.getCN().Close() Return ajustelist.ToArrayEnd Function\[/code\]but I think is wrong because I was calling this function into my code behind:\[code\]Dim opd As New OPDAO For Each objAjuste In opd.obtenerDataAjuste(CInt(Session("idop"))) Dim pesomix As Decimal = objAjuste.pesomix Dim pesoprod As Decimal = objAjuste.pesoprod Dim empaque As Integer = objAjuste.unidad 'Reajuste unidad ajustado Dim unidadajustado As Double = pesomix / pesoprod Session("undajustado") = Convert.ToInt32(unidadajustado) 'Reajuste paquete ajustado Dim paqueteajustado As Double = Session("undajustado") / empaque Session("pqtajustado") = paqueteajustado Next\[/code\]and it doesn't work for me, it returns the last record. Can anyone help me please?.Thanks!