Transaction when using smo and DataContext of linq

G

Guest

In the operation,it is neccessary to create a new table by smo and then
insert some data into the new table by DataContext.Executecommand().
Is it possible to implement in a transaction? If no,any adivise?
Thanks.
 
M

Marc Gravell

I haven't tried (I'm not a big fan of too much CREATE TABLE inside an
app [except for @ or #]), but \you could try wrapping the whole thing
in a TransactionScope... alternatively, use raw SQL to create the
table insead of SMO?

Marc
 
P

Paker Liu

Thanks for your reply.
I will test the case with TransactionScope and send a report about the
results later.
thank you again.
Paker Liu
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top