DataAdapter.Update and transaction

  • Thread starter Thread starter Zanna
  • Start date Start date
Z

Zanna

A simple question: the DataAdapter.Update implements some transaction
internally?

If no how can I do it?
If a put a transaction on the connection used by the DA the
CommandBuilder give me an exception :(

Thanks!
 
The adapter doesn't care about the transaction per se. Can you post the
code you are using?
AFAIK, you should be good to go - I haven't used them with the DataAdapter
but I haven't seen anything indicating it's not kosher and it works based on
the connection so I don't think it's an issue.



SqlCeConnection cn = new SqlCeConnection(myConnString);
cn.Open();

SqlCeTransaction myTransaction;

myTransaction = cn.BeginTransaction();

// Must assign both transaction object and connection
// to Command object for a pending local transaction
myCommand.Connection = cn;
myCommand.Transaction = myTrans;da.Fill(dataSetName, "TableName");
--

W.G. Ryan, eMVP

Have an opinion on the effectiveness of Microsoft Embedded newsgroups?
Let Microsoft know!
https://www.windowsembeddedeval.com/community/newsgroups
 
Back
Top