Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > How to Update The BindingSource?
 

How to Update The BindingSource?

Hi,

I have one DataTable, with two: BindingSource1 & BindingSource2...

I added one item (record) to BindingSource1 from Form1 and save data back to the table adapter and database, I returned to BindingSource2 but I couldnt find the new record.

how to solve this problem?

HSBF Lewe  Sunday, April 22, 2007 8:29 AM
While on the same form, the BindingSources use the same BindingContext if you set both DataSource to be same. For cross forms screnario, you can fill your dataset again by TableAdapter or SqlDataAdapter to reload data from database.
Zhi-Xin Ye  Thursday, April 26, 2007 1:23 PM

Hi:

if you are sure the data have been save back to database,

I think you need to reset the binding source2 to force it update.

Bob zhu - SJTU  Monday, April 23, 2007 1:47 AM

Thanks Bob,

I tried to reset it by:

DataBinding2.ResetBindings(false);

doesnt work !

then I tried:

DataBinding2.ResetBindings(true);

doesnt work too !

HSBF Lewe  Monday, April 23, 2007 8:33 AM

I tried to use to bindingSource in the same Form, it work without reseting the binding source, but when I use a two defrent forms it doesnt work !!

any help?

HSBF Lewe  Monday, April 23, 2007 8:57 AM

Hiļ¼?/p>

I means you can set BindingSource.Datasource=null then reset it like BindingSource.Datasource=SomeDataSource.

to ensure your Bindingsource sync with your database.

Bob zhu - SJTU  Monday, April 23, 2007 9:26 AM
While on the same form, the BindingSources use the same BindingContext if you set both DataSource to be same. For cross forms screnario, you can fill your dataset again by TableAdapter or SqlDataAdapter to reload data from database.
Zhi-Xin Ye  Thursday, April 26, 2007 1:23 PM

You can use google to search for other answers

Custom Search

More Threads

• Data Grid
• Datagridview + anonymous method
• How to make currently selected row invisible ?
• How to pass values to App.Config file in c#?
• does it make a difference if the value given to CmbBOX.ValueMember is lower or upper case
• .net questions
• Cell X Y Coordinates
• How undo delete in BindingNavigator ?
• DGV bound to BindingList<obj>, how to save checkbox values when checked?
• Accessing Selected Data On Active Window.