Jump to content
meyhugo

erro do botão

Recommended Posts

meyhugo

Eu carrego no botão e da-me erro , o programa ta sem erros ,ta tudo bem programado,  num amigo meu o mesmo programa sem ser alterões corre sem nenhum problema , o que devo faser para resolver este meu problema????

não tou a conseguir por as imagens por isso deixo aqui o link

http://imageshack.us/photo/my-images/29/img05072011225721.png/

http://imageshack.us/photo/my-images/808/img05072011230134.png

img05072011225721.pngimg05072011230134.png

Share this post


Link to post
Share on other sites
meyhugo

Form4.Show()

disto sai uma janela a diser

ArgumentException Was unhandled

Cannot bind to the property or column Estado on the DataSource.

Parameter name: dataMember

Troubleshooting tips:

Get general help for this exception.

search for more help online...

Actions:

View Detail...

Copy exception detail to the clipboard

Share this post


Link to post
Share on other sites
Caça

Mostra o código que tens no load nessa form, é ai que está o erro.


Pedro Martins

Não respondo a duvidas por PM

Share this post


Link to post
Share on other sites
meyhugo

e isto que pediste ??

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub
End Class


Private Sub FrmStand_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.VeiculosTableAdapter.Fill(Me.Database1DataSet1.Veiculos)
        Me.BindingNavigatorAddNewItem.Enabled = True
        Me.BindingNavigatorDeleteItem.Enabled = True
        For CTD = DateAndTime.Today.Year To 1980 Step 1
            ComboAno.Items.Add(CTD)
        Next
    End Sub

    Private Sub FrmStand_Loadclosing(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.Validate()
        Me.VeiculosBindingSource.EndEdit()
        Me.TableAdapterManager.UpdateAll(Me.Database1DataSet1)
    End Sub

Share this post


Link to post
Share on other sites
Caça

Isso é o código que tens no load do Form4?


Pedro Martins

Não respondo a duvidas por PM

Share this post


Link to post
Share on other sites
meyhugo

sim porque ja e a nova tentativa que tinha mas ja ta tudo como estava

Share this post


Link to post
Share on other sites
Caça

Na primeira imagem está a dar erro na linha Form4.Show() e eu pedi para colocares aqui o código da Form4, mas estas a colocar aqui código da form FrmStand e Form1, o que não me serve de nada...


Pedro Martins

Não respondo a duvidas por PM

Share this post


Link to post
Share on other sites
meyhugo

mas o FrmStand e o Form4

ta aqui todo o codigo do Form4

Public Class FrmStand

    Private Sub FrmStand_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.VeiculosTableAdapter.Fill(Me.Database1DataSet1.Veiculos)
        Me.BindingNavigatorAddNewItem.Enabled = True
        Me.BindingNavigatorDeleteItem.Enabled = True
        For CTD = DateAndTime.Today.Year To 1980 Step 1
            ComboAno.Items.Add(CTD)
        Next
    End Sub

    Private Sub FrmStand_Loadclosing(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.Validate()
        Me.VeiculosBindingSource.EndEdit()
        Me.TableAdapterManager.UpdateAll(Me.Database1DataSet1)
    End Sub

    Private Sub BindingNavigatorDeleteItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BindingNavigatorDeleteItem.Click
        Dim mensagem, botões, icone
        Dim resposta As DialogResult
        If TxtCodigo.Text <> Nothing Then
            mensagem = "Deseja eliminar o registo actual"
            botões = MessageBoxButtons.YesNo
            icone = MessageBoxIcon.Question
            resposta = MessageBox.Show(mensagem, botões, icone)
            If resposta = Windows.Forms.DialogResult.Yes Then
                VeiculosBindingSource.EndEdit()
                VeiculosTableAdapter.Delete(CDec(TxtCodigo.Text))
                VeiculosTableAdapter.Fill(Database1DataSet1.Veiculos)
            End If
        End If
    End Sub

    Private Sub VeiculosBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles VeiculosBindingNavigatorSaveItem.Click
        Me.Validate()
        Me.VeiculosBindingSource.EndEdit()
        Me.TableAdapterManager.UpdateAll(Me.Database1DataSet1)
        TextBox1.Clear()
    End Sub

    Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click
        FrmPesquisa.Show()
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Form1.Show()
        Hide()
    End Sub

    Private Sub ImagemPictureBox_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ImagemPictureBox.Click

    End Sub
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Try
            OpenFileDialog1.ShowDialog()

            TextBox1.Text = OpenFileDialog1.FileName
            TxtModelo.Text = OpenFileDialog1.SafeFileName

            ImagemPictureBox.Image = Image.FromFile(TextBox1.Text)
        Catch ex As Exception
            MessageBox.Show("Não selecionou nenhuma imagem!")
        End Try
    End Sub
End Class

http://img221.imageshack.us/img221/905/img06072011225513qjh.png

Share this post


Link to post
Share on other sites
Caça

Então aqui já não está Form4, mas sim FrmStand, certo?

Tens o teu DataSet as as ligações actualizadas?


Pedro Martins

Não respondo a duvidas por PM

Share this post


Link to post
Share on other sites
meyhugo

como faço isso e no refresh ??

e sim ja nao e Form4 mas sim FrmStandd

Share this post


Link to post
Share on other sites
Caça

Procura na janela DataSources. Fizeste alguma alteração recente na BD?


Pedro Martins

Não respondo a duvidas por PM

Share this post


Link to post
Share on other sites
meyhugo

Fiz criei uma nova porque nao aceitava as os dados.  o que faço para corrigir isto agora ???

Share this post


Link to post
Share on other sites
Caça

O UpdateCommand está actualizado?


Pedro Martins

Não respondo a duvidas por PM

Share this post


Link to post
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.