S
Srini
Would this be an okay practice in an aspx page (I am using oledb)
oledbconnection cn = new .......
oledbcommand cmd = new .....
cmd.connection = cn
oledbtransaction trans = cn.begin.........
cmd.transaction = trans
cmd.commandtext = "UPDATE..xx..."
cmd.executenonquery()
cmd.commandtext = "UPDATE..yy..."
cmd.executenonquery()
trans.commit() //or rollabck
cmd.transaction = null
cmd.commandtext = "SELECT ...." //Should I create a new cmd object ?
oledbdatareader dr = cmd.executereader(........
Is it ok to use the same command object(its local to the page) for multiple
database transactions (They are sequential operations - not multithreaded) ?
Do I have to set the cmd.transaction = null after a Commit or Rollback
before using it for another another select ?
TIA
Srini
oledbconnection cn = new .......
oledbcommand cmd = new .....
cmd.connection = cn
oledbtransaction trans = cn.begin.........
cmd.transaction = trans
cmd.commandtext = "UPDATE..xx..."
cmd.executenonquery()
cmd.commandtext = "UPDATE..yy..."
cmd.executenonquery()
trans.commit() //or rollabck
cmd.transaction = null
cmd.commandtext = "SELECT ...." //Should I create a new cmd object ?
oledbdatareader dr = cmd.executereader(........
Is it ok to use the same command object(its local to the page) for multiple
database transactions (They are sequential operations - not multithreaded) ?
Do I have to set the cmd.transaction = null after a Commit or Rollback
before using it for another another select ?
TIA
Srini