Jump to content
Fórum Script Brasil
  • 0
Sign in to follow this  
kALAND

Vb.net

Question

Olá pessoal boa tarde, estou tentando fazer com que ao efetuar uma venda ao clicar em finalizr abre um forme onde me passe apenas as informações dessa ultima venda, mas no meu código ele esta retornando todas as vendas, alguém poderia me ajudar?

 

Private Sub btnfinalizar_Click(sender As Object, e As EventArgs) Handles btnfinalizar.Click
        Dim numero As Integer
        con.Open()
        sql = "select * from faturas where nfaturas = '" & txtnfatura.Text & "'"

        da = New FbDataAdapter(sql, con)
        tabela = New DataTable()
        da.Fill(tabela)
        numero = tabela.Rows.Count
        con.Close()

       
        obterultimoregistro()
        F_relfaturas.Show()

    End Sub

    Private Sub obterultimoregistro()


        Try
            con.Open()
            Dim cmd As New FbCommand
            cmd.CommandText = "select MAX (nfaturas) from faturas"
            cmd.CommandType = CommandType.Text
            cmd.Connection = con
            da.SelectCommand = cmd
            con.Close()
            tabela.Clear()
            da.Fill(tabela)

            Dim nfaturas As String = tabela.Rows.Item(0).Item(0).ToString


        Catch ex As Exception
            MsgBox(ex.Message)

        End Try


    End Sub

Share this post


Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

Cloud Computing


  • Forum Statistics

    • Total Topics
      148420
    • Total Posts
      643845
×
×
  • Create New...