using (DbTransaction trans = connection.BeginTransaction())
{
  // loop goes here
  //
  // loop ends here

  trans.Commit();
}

Best place to get answers to .NET-related SQLite questions (and more) is at
http://sqlite.phxsoftware.com/forums

Robert

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of danblack101
Sent: Friday, August 08, 2008 2:01 PM
To: sqlite-users@sqlite.org
Subject: [sqlite] c# .net beginTrans...where is endtrans?


Hi,
I have a c#  program which has to process a large amount of updates at one
time.
I have previously used:

connection.beginTransaction()
commandObject
<loop>
      update SQLite with command object
<loop end>
commandObject.Transaction.Commit

This worked nicely.

But now I have modulised my code so that I have a generic
updateFunction(String) inside this function I create a commandObject and do
the update which is fine, but....

Now I have reached a point where I want to process a large amount of updates
therefore need transaction boundaries. So now I have 

connection.beginTransaction()
<loop>
    updateFunction(String)
<loop end>



????How can I commit, I dont have a command object that performs the
commit/endTrans, I dont want to commit inside the updateFunction ?????


Any help is greatly appreciated 
Dan




-- 
View this message in context:
http://www.nabble.com/c--.net-beginTrans...where-is-endtrans--tp18898927p188
98927.html
Sent from the SQLite mailing list archive at Nabble.com.

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to