日期:2014-05-17 浏览次数:21293 次
using (TransactionScope scope = new TransactionScope())
{
string ConnectionString = "User ID=test;Password=test;Data Source=myx;";
Oracle.DataAccess.Client.OracleConnection connection = new Oracle.DataAccess.Client.OracleConnection(ConnectionString);
connection.Open();
Oracle.DataAccess.Client.OracleCommand command = connection.CreateCommand();
command.CommandText = "insert into CESHI(CS,WEWE) values('111','2222')";
command.CommandType = CommandType.Text;
command.ExecuteNonQuery();
string ConnectionString2 = "User ID=test;Password=test;Data Source=myx;";
Oracle.DataAccess.Client.OracleConnection connection2 = new Oracle.DataAccess.Client.OracleConnection(ConnectionString2);
connection2.Open();
Oracle.DataAccess.Client.OracleCommand command2 = connection2.CreateCommand();
command2.CommandText = "insert into WRERER(RERER,SDSD) values('1111','2222')";
command2.CommandType = CommandType.Text;
command2.ExecuteNonQuery();
scope.Complete();
}