Click here to Skip to main content
15,791,353 members

Comments by Alegria_Lee (Top 8 by date)

Alegria_Lee 24-Aug-11 1:49am View    
Thanks digimanus!I have found out why I got such a error infomation on calling sqltransaction.commit(). It has nothing to do with what kind of method that I used to submit data.My colleague added an update trigger that if the insert time is not the same as the server time,then it will rollback automatically.This is why my code return that error.
Alegria_Lee 23-Aug-11 21:16pm View    
No matter MARS is enabled or disabled,in either case,once time is changed,there will be a error when committing the transaction.
Alegria_Lee 23-Aug-11 20:54pm View    
I tend to execute insert,update and delete commands in one time,each command effects a different table at least one row.Like,I put all modifed data in one dataset,dataset.tables[0] is for updating;dataset.tables[1] is for inserting;dataset.tables[2] is for deleting.then,I Open a transaction, execute update,insert and delete commands in turn ,after that,commit the transaction.
Alegria_Lee 23-Aug-11 5:23am View    
Thank you .But my question is not how to use transaction .Instead ,my question is why I can´t commit the transaction when computer date is different between server (running database )and client (running application ).
Alegria_Lee 19-Nov-10 0:09am View    
As datetime is a "struct",I assume what you want is a "string".Then,just change your code as below:
string strdatetime = Convert.ToDateTime(fromDateTime).ToString("YYYY-MM-DD HH24:MI:SS");