J
J055
Hi
I've read various articles/blogs/posts about adding transactions to
TableAdapters, mainly from Sahil Malik. I'm certainly not an expert in
ADO.NET but I understand what transactions, commands and connections are.
Sadly I've been unable to get the examples I found to work.
I want to be able to work with 2 or more TableAdapters within one
transaction. I understand that I need to extend the appropriate TableAdapter
partial classes. This isn't too much of a problem because I only have 10 or
so database tables and TableAdapters to worry about.
I don't think I want to use System.Transaction.TransactionScope. I'm only
concerned with one database. I would like to continue to use TableAdapters
(because I've already invested time implementing for non-transactional
uses).
Another thing: I need to do quite a bit of manipulation of the DataTable
between Filling and Updating using the TableAdapter(s) so it makes sense to
do this in my business logic layer. However, if I need to work with
transactions then the business layer is no longer 'Data Provider neutral',
i.e. in my case, I need to work with the System.Data.SqlClient namespace. I
don't suppose this is a real world problem for me but if a customer did want
to use Oracle with our application then we have to create a new DAL and BLL.
Is there a tried and tested solution out there yet that someone would be
good enough to share?
Thanks
Andrew
I've read various articles/blogs/posts about adding transactions to
TableAdapters, mainly from Sahil Malik. I'm certainly not an expert in
ADO.NET but I understand what transactions, commands and connections are.
Sadly I've been unable to get the examples I found to work.
I want to be able to work with 2 or more TableAdapters within one
transaction. I understand that I need to extend the appropriate TableAdapter
partial classes. This isn't too much of a problem because I only have 10 or
so database tables and TableAdapters to worry about.
I don't think I want to use System.Transaction.TransactionScope. I'm only
concerned with one database. I would like to continue to use TableAdapters
(because I've already invested time implementing for non-transactional
uses).
Another thing: I need to do quite a bit of manipulation of the DataTable
between Filling and Updating using the TableAdapter(s) so it makes sense to
do this in my business logic layer. However, if I need to work with
transactions then the business layer is no longer 'Data Provider neutral',
i.e. in my case, I need to work with the System.Data.SqlClient namespace. I
don't suppose this is a real world problem for me but if a customer did want
to use Oracle with our application then we have to create a new DAL and BLL.
Is there a tried and tested solution out there yet that someone would be
good enough to share?
Thanks
Andrew