ChoKamir
Member
Hey,
First of all i work with an access database. In my program i made an DataAdapter with retrieves rows from the database from two tables(through an inner join). Because the dataset linked to this DataAdapter is represented in a datagridview i also wrote insert, delete and update commands.
The way i solved the insert in two tables is with an transaction. In the RowUpdating event of the DataAdapter i create an transaction and manually insert the row in one of the tables. The insertcommand of the dataadapter will handle the insert in the other table. In the RowUpdated event of the dataadapter i commit the transaction.
This works all fine, except for the fact that some values in the datagrid are left empty because then the default values will be inserted and there is a column with a expression (calculating the product of two columns of a row). Now the default values wont appear nor will the column with the expression show a value. The reason for this is that the inserted data into the database is not returned to the dataset.
So how can i make sure that the actual data of the inserted row in the database is reflected to the dataset?
Thanks for helping
ChoKamir
First of all i work with an access database. In my program i made an DataAdapter with retrieves rows from the database from two tables(through an inner join). Because the dataset linked to this DataAdapter is represented in a datagridview i also wrote insert, delete and update commands.
The way i solved the insert in two tables is with an transaction. In the RowUpdating event of the DataAdapter i create an transaction and manually insert the row in one of the tables. The insertcommand of the dataadapter will handle the insert in the other table. In the RowUpdated event of the dataadapter i commit the transaction.
This works all fine, except for the fact that some values in the datagrid are left empty because then the default values will be inserted and there is a column with a expression (calculating the product of two columns of a row). Now the default values wont appear nor will the column with the expression show a value. The reason for this is that the inserted data into the database is not returned to the dataset.
So how can i make sure that the actual data of the inserted row in the database is reflected to the dataset?
Thanks for helping
ChoKamir