Click here to Skip to main content
13,195,379 members (62,361 online)
Rate this:
Please Sign up or sign in to vote.
Hi Team,

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.

Posted 2-Dec-12 18:10pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.171019.1 | Last Updated 3 Dec 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100