110,571
社区成员
发帖
与我相关
我的任务
分享
OracleConnection con = new OracleConnection("Data Source = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS =(PROTOCOL = TCP)(HOST = 192.168.2.11)(PORT =1521)))(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME =...))); User Id = ...; Password = ...");
---create table a(b varchar2(100),c varchar2(100))表名
create or replace procedure inserta is
begin
SAVEPOINT WSSMSSUBMIT1;
insert into a(b) values('132');
commit;
exception when others then
ROLLBACK TO WSSMSSUBMIT1;
end inserta;
OracleConnection con = new OracleConnection("....");
OracleCommand command = new OracleCommand();
command.Connection = con;
try
{
con.Open();
command.CommandText = "inserta";
command.CommandType = CommandType.StoredProcedure;
command.ExecuteNonQuery();
}
catch (Exception ex)
{
con.Close();
throw new Exception(ex.Message);
}