Was interested on the following. Seams to many different answers after Google this.
(It could be I dont understand the concept of Databinding either, fairly new to this concept)
I have a list of Strings which came from a Database that I am databinding to a list Box.
mXXBindiongs = new DataBindingSource
mXXDataSet = DB.GetDataSet
mXXBindiongs.DataSource = mXXDataSet
mXXBindiongs.DataMember = mXXDataSet.Tables(0).TableName
ListBox.DataSource = mXXBindiongs
ListBox.DisplayMember = "HeadingX"
With certain operations with-in the Winform I want to capture the resulting string add it to the list so it updates the Database as well as update the List Box in WinForm.
I am a little confused as the correct way to update this and all updates to occur.
If someone could help that would be wonderfull.
Many Thanks in advance.
You'll have to update the database with the new item, then requery the database to retrieve the updated table.
BTW, your binding is a bit screwy. You normally don't bind to a DataSet. You bind to a DataTable in the DataSet and the DataMember name is the column in the table you want to bind to.
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)