Q:

Save changes in database using BindingSource

I retrieve data from database like this:
OleDbDataAdapter dataAdapter 
            = new OleDbDataAdapter("SELECT * "
              + " FROM myTab1, myTab2"
              + " WHERE myTab1.col1 = myTab2.col3"
              , connection);//OleDbConnection connection = new OleDbConnection();
DataTable dataTable = new DataTable("myDataTable");
BindingSource bindingSource = new BindingSource();
bindingSource.DataSource = dataTable;
dataAdapter.Fill(dataTable);  

Then I use bindingSource in order to access the data in my program, everything works perfect. But after all changes I've made in bindingSource, I need so save them into the database. How can I do this?

A:

Well normally you'd call Update() on the DataAdapter:
dataAdapter.Update(dataTable);

But since your query "joins" two tables it may not be so easy.  It may be possible if you turn your SELECT query into a proper join:
  "SELECT * "
+ "FROM myTab1 "
+ "JOIN myTab2 ON myTab1.col1 = myTab2.col3"

Some other alternatives:

Write an UPDATE statement that will put the right values in the right tables and set your dataAdapter's UpdateStatement
Populate the dataset with separate tables (one per base table) and join in your app

More info from MSDN:
http://msdn.microsoft.com/en-us/library/xzb1zw3x(v=vs.80).aspx

