Jump to content

Erro a passar código de Visual Basic 2019 para Visual Basic 2010


Tomas Duarte

Recommended Posts

Ola, alguém me poderia ajudar estou a passar um programa de visual Basic 2019 para Visual Basic 2010 

Criei uma class e coloquei la dentro um modulo e está me a dar erro no seguinte codigo: 

  Dim bs As New BindingSource
        bs.DataSource = dtFATURA

        bs.Filter = "ID_ENTREGA =" & FATURA

        xlivro.Range("B5").Value = FATURA
        xlivro.Range("B6").Value = DATA
        xlivro.Range("B8").Value = CLIENTE
        xlivro.Range("B7").Value = MORADA

        For Each view As DataRowView In bs
            Dim row = view.Row
            CODIGO = row("CODIGO")
            PRODUTO = row("PRODUTO")
            QUANTIDADE = row("QUANTIDADE")
            PESO = row("PESO")
            TOTAL = row("TOTAL")

            xlivro.Range("A" & RANGO).Value = CODIGO
            xlivro.Range("B" & RANGO).Value = PRODUTO
            xlivro.Range("C" & RANGO).Value = QUANTIDADE
            xlivro.Range("D" & RANGO).Value = PESO
            xlivro.Range("E" & RANGO).Value = TOTAL
            xlivro.Range("F" & RANGO).Value = QUANTIDADE * TOTAL
            TotalFacturado = TotalFacturado + (QUANTIDADE * TOTAL)
            RANGO += 1

        Next

No "for Each view as DataRowView In bs " 

Da o seguinte erro "Error 1 Expression is of type 'Reportes.BindingSource', which is not a collection type."

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.