熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> ASP編程 >> 正文

ado.net執行oracle 存儲過程

2022-06-13   來源: ASP編程 
 執行oracle 存儲過程如下:
    OracleConnection con=new OracleConnection(strcon);
    OracleCommand  cmd=new OracleCommand();
    OracleTransaction mytrans ;
    try
    {
    conOpen ();
    mytrans =conBeginTransaction();
    cmdConnection =con;
    cmdCommandText =rfgetid;
    cmdCommandType =CommandType StoredProcedure;
    cmdTransaction =mytrans ;
    OracleParameter parameter_in=new OracleParameter(as_bmOracleTypeChar);
    OracleParameter parameter_out=new OracleParameter (as_sxhOracleType Number );
    parameter_inDirection =ParameterDirection Input;
    parameter_outDirection=ParameterDirection Output ;
    parameter_in Value =tblnameToUpper();
    cmdParameters Add(parameter_in );
    cmdParametersAdd(parameter_out);
    cmdExecuteNonQuery();
    mytrans Commit();
    return  intParse(parameter_out ValueToString()) ;
    }
    catch(Exception er)
    {
    throw new Exception(erMessage);
    mytrans Rollback();
    }
    finally
    {
    cmdDispose ();
    conClose ();
    }
From:http://tw.wingwit.com/Article/program/ASP/201311/21778.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.