Hello Marty,
Thanks for Sccott's suggestion.
At beginning, I'd like to check if you are developing Winform Application.
(or WebForm Application?)
I assume your application is developing in Winform project model. If I have
misunderstood, please correct me. Thanks.
Scrrot has provided the correct direction. Setting the data bindings is not
what queries the data. In order to refresh the data, we would have to
modify the underlying dataset/datatable.
I'm not sure how you wrote the connection/query code (is it generated by VS
2005 IDE?). If all codes generated by VS 2005, I think there must be many
components on form1 designer surface. (such as DataSet,
BindingSource,TableAdapter and BindingNavigator).
1) To refresh the new data from underlying database, we would have to use
TableAdapter to fill DataSet.
public void refreshDataSource()
{
this.table_1TableAdapter.Fill(this.adventureWorksDataSet.Table_1);
}
2) If you just want to add new row into the dataset, you could create
AddRow() Method in Form1 class and call this method in Form2's unload event
handler.
public void addNewRow(AdventureWorksDataSet.Table_1Row newRow)
{
this.adventureWorksDataSet.Table_1.AddTable_1Row(newRow);
}
The issue sounds not complex. If you could let me know the actual scenario,
I could provide a sample for you.
Hope this helps
Sincerely,
Wen Yuan
Microsoft Online Community Support
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.