Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

Combobox bindingSource doesn't save

$
0
0

I am using vb.net with Access database - In my app I have ComboBox control with databinding

Me.ComboBox1.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.StudenttableBindingSource, "Age", True))

and I have a button named BttnSave with this code

Private Sub BttnSave_Click(sender As Object, e As EventArgs) Handles BttnSave.Click
    Me.StudenttableBindingSource.EndEdit()
    Me.StudenttableTableAdapter.Update(Me.StudentDataSet.studenttable)
    Me.StudenttableTableAdapter.Fill(Me.StudentDataSet.studenttable)
    MsgBox(" Student Saveed", MsgBoxStyle.Information)
    Me.StudenttableTableAdapter.Fill(Main.StudentDataSet.studenttable)
    Me.Close()
End Sub

When I select an item from ComboBox and click BttnSave the selected item saves ok. The problem is when i use mouse scroll to select item from ComboBox witout opening DropDown and click BttnSave the item not saved


Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>