Form Data Binding Confusion

I've got a similar issue to the question posed on EE here; http://www.experts-exchange.com/Programming/Languages/.NET/Visual_Basic.NET/Q_23022296.html but the resolution doesn't work with mine.

Basically I have a MSSQLCE database with a number of tables, which has been added to my vb 2005 project as a datasource, and I have created a standard form which has had the fields bound to the datasource by dragging and dropping from the datasource tab onto the form.  There is also a 'New' and a 'Save' button.

Clicking the 'New' button does the following:
        Me.ChannelsBindingSource.AddNew()

I can then enter data onto the form and click the 'Save' button' to save the data, which does the following:
                Me.Validate()
                Me.ChannelsBindingSource.EndEdit()
                Me.ChannelsTableAdapter.Insert(Me.tbChannels.Text)
                Me.ChannelsTableAdapter.Update(Me.MiV2DataSet)

(There are actually more fields than specified in the Insert)

Now this works, but I would have thought one of the advantages of databinding was that I shouldn't have to specify every field that needs to be inserted and the code in the link above seems to back this up.

Any help would be appreciated.

nurcombeAsked:
Who is Participating?
 
nurcombeConnect With a Mentor Author Commented:
Found the problem, rather than
    Me.ChannelsTableAdapter.Update(Me.MiV2DataSet)

I needed to have
    Me.ChannelsTableAdapter.Update(Me.MiV2DataSet, Channel)

Many thanks for trying to help.
0
 
VBRocksCommented:
No, you shouldn't need to do that.

Check and make sure the controls are bound to the bindingsource.

Right-Click on the textbox, select Properties.  In the Properties window, go to the top, expand "DataBindings" and make sure the Text property is bound to the BindingSource and field.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.