Public Function CarregaRel_GapProdutos() As SqlDataReader
Dim dr1 As SqlDataReader
command.CommandText = "procedure"
command.CommandType = CommandType.StoredProcedure
command.CommandTimeout = 500
command.Connection = connection
command.Parameters.Add("@pram1", SqlDbType.Int, 4).Value = 0
command.Parameters.Add("@pram2", SqlDbType.VarChar, 30).Value = DBNull.Value
command.Parameters.Add("@pram3", SqlDbType.VarChar, 50).Value = DBNull.Value
command.Parameters.Add("@pram4", SqlDbType.VarChar, 50).Value = DBNull.Value
command.Parameters.Add("@pram5", SqlDbType.VarChar, 30).Value = DBNull.Value
command.Parameters.Add("@pram6", SqlDbType.VarChar, 10).Value = DBNull.Value
command.Parameters.Add("@pram7", SqlDbType.VarChar, 30).Value = DBNull.Value
command.Parameters.Add("@pram8", SqlDbType.Int, 4).Value = 1
dr1 = command.ExecuteReader()
Return dr1
End Function
fiz a função acima.
aí para chamá-la (no webform) faço assim:
Private ReadOnly Property Data() As Object()
Get
Dim now As DateTime = DateTime.Now
Dim i As Integer
Dim total As Integer
dr = acesso.CarregaRel_GapProdutos()
total = dr.FieldCount
i = 1
Do While dr.Read()
Return New Object() { _
New Object() _
{dr("coluna14").ToString(), _
dr("coluna1").ToString(), _
dr("coluna2").ToString(), _
dr("coluna3").ToString(), _
dr("coluna4").ToString(), _
dr("coluna5").ToString(), _
dr("coluna6").ToString(), _
dr("coluna7").ToString(), _
dr("coluna8").ToString(), _
dr("coluna9").ToString(), _
dr("coluna10").ToString(), _
dr("coluna11").ToString(), _
dr("coluna13").ToString(), _
dr("coluna14").ToString()}}
Loop
End Get
End Property
só que só está trazendo o primeiro registro mesmo a variável tendo 14 registros no total. porque/