欢迎光临
我们一直在努力

使用存储过程的一个小例子-.NET教程,评论及其它

建站超值云服务器,限时71元/月

public overloads sub update(byval authorityarr as ilist)

log.debug("update a record in table tbl_m_authority")

dim connection as oracleconnection = new oracleconnection(orahelper.conn_string_local)

dim command as oraclecommand = new oraclecommand(plsql_update, connection)

command.commandtype = commandtype.storedprocedure

dim txn as oracletransaction

dim updateparms() as oracleparameter = {new oracleparameter(parm_auth_cd, oracledbtype.varchar2) _

, new oracleparameter(parm_auth_name, oracledbtype.varchar2) _

, new oracleparameter(parm_shori_staff_cd, oracledbtype.decimal) _

, new oracleparameter(parm_void_flg, oracledbtype.varchar2) _

, new oracleparameter(parm_disp_order, oracledbtype.decimal)}

dim authinfo as authorityinfo

try

connection.open()

txn = connection.begintransaction(isolationlevel.readcommitted)

for each authinfo in authorityarr

updateparms(0).value = authinfo.auth_cd

updateparms(1).value = authinfo.auth_name

updateparms(2).value = authinfo.shori_staff_cd

updateparms(3).value = authinfo.void_flg

if authinfo.disp_order_str is nothing or authinfo.disp_order_str.trim = "" then

updateparms(4).value = dbnull.value

else

updateparms(4).value = decimal.parse(authinfo.disp_order_str)

end if

dim params as oracleparameter

command.parameters.clear()

for each params in updateparms

command.parameters.add(params)

next

command.executenonquery()

next

txn.commit()

catch ex as exception

txn.rollback()

log.debug(ex.message)

log.debug(ex.stacktrace)

throw ex

finally

if not connection is nothing then

connection.close()

connection.dispose()

end if

if not command is nothing then

command.dispose()

end if

end try

end sub

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 使用存储过程的一个小例子-.NET教程,评论及其它
分享到: 更多 (0)

相关推荐

  • 暂无文章