i have a question on how to work properly with related datatables and how to actualize them properly in the backend source database.
the situation is following:
I have a SQL database (SQL Server) which is the basic data source. In here the tables can have relation with each other via foreign keys.
this SQL database i use to fill datatables via SQL queries. The resulting datatables i use to visualize the information on the formular
var query = new SqlCommand(_sqlquery, connection); var sqlAdapter = new SqlDataAdapter(query); sqlAdapter.Fill(dataTable);
...
Here i am using sql queries to get the needed information into my datatables for example:
SELECT * FROM [order] INNER JOIN customer ON [order].customerID = customer.customerID;
So far so good the the visualization in the datagrid is working well.
BUT the problems are rising when trying to save modifications on the visualized data in the datagrid back in the source sql database.
I searched a lot in the internet and the solution seems to be the usage of TableAdapterManager. The problem is that i don't really understand how to connect my code i have already to visualize the data with the TableAdapterManager which can actualize the data in the sql database.