You can create a
DataSet
that matches the tables in your database.
Then you can bind the different user controls to the columns in the data tables in the dataset.
The datagrid you bind to one whole data table.
For example, one data table,
Table1
, for the text boxes and date picker and another table for the datagrid,
Table2
.
Table1
will only contain data row, but
Table2
will contain several rows so here you need to loop through the rows and save them one by one in your DB.
DataRow dr1 = Table1.Rows.FirstOrDefault();
if (dr1 != null)
{
}
foreach (DataRow dr in Table2.Rows)
{
}
This is a very rudimentary example, but I hope you get the picture.
// George