OracleConnection con=new OracleConnection(strcon);
OracleCommand cmd=new OracleCommand();
OracleTransaction mytrans ;
try
{
con.Open ();
mytrans =con.BeginTransaction();
cmd.Connection =con;
cmd.CommandText ="rfgetid";
cmd.CommandType =CommandType .StoredProcedure;
cmd.Transaction =mytrans ;
OracleParameter parameter_in=new OracleParameter("as_bm",OracleType.Char);
OracleParameter parameter_out=new OracleParameter ("as_sxh",OracleType .Number );
parameter_in.Direction =ParameterDirection .Input;
parameter_out.Direction=ParameterDirection .Output ;
parameter_in .Value =tblname.ToUpper();
cmd.Parameters .Add(parameter_in );
cmd.Parameters.Add(parameter_out);
cmd.ExecuteNonQuery();
mytrans .Commit();
return int.Parse(parameter_out .Value.ToString()) ;
}
catch(Exception er)
{
throw new Exception(er.Message);
mytrans .Rollback();
}
finally
{
cmd.Dispose ();
con.Close ();
}
Word教程网 | Excel教程网 | Dreamweaver教程网 | Fireworks教程网 | PPT教程网 | FLASH教程网 | PS教程网 |
HTML教程网 | DIV CSS教程网 | FLASH AS教程网 | ACCESS教程网 | SQL SERVER教程网 | C语言教程网 | JAVASCRIPT教程网 |
ASP教程网 | ASP.NET教程网 | CorelDraw教程网 |