cannot bind to the property or column

johncassell

Well-known member
Joined
Jun 10, 2007
Messages
120
Location
Redcar, England
Programming Experience
Beginner
Hi There,

Can someone help me with the following please...

(I have looked around the net first but all explanations are too complicated for my simple mind..)

I have a form which i use to update my Products database table. All boxes are textboxes except my Product_Name combobox.

I would like this to be a drop down menu showing all possible Product Names to choose from.

This works but when I exit the form I get the attached error.

Can anyone explain what I am doing wrong please?

Thanks

John
 

Attachments

  • error.JPG
    error.JPG
    19 KB · Views: 45
you probably have a .Filter or .RowFilter set somewhere in the binding chain for a data bound control (not necessarily your combo) on the form.

Forms that house compnents that have an active Filter sometimes throw this error upon close

Add this:
VB.NET:
    Protected Overrides Sub OnFormClosing(ByVal e As System.Windows.Forms.FormClosingEventArgs) 
        'use ONE of these, or something like ONE of  these
        yourXXXBindingSource.RemoveFilter()
        yourXXXBindingSource.Filter = Nothing
        yourXXXDataView.RowFilter = Nothing

        MyBase.OnFormClosing(e)
    End Sub

making it relevant for whichever component youre using
 
Hi cjard,

thanks for the reply. However, I have managed to fix it.

Not totally sure how but I think it was because i had a productstableadapter and when I bound the control to a new productstableadapter1 (even though it was essentially the same thing) it seemed to work from then on.

Appreciate the reply none the less.

John
 
Back
Top