I have a disconnected datatable that contains a few records. I am using the following function to get the dataTable.
c# Code:
  1. static System.Data.DataTable ReadSetUpTable(string queryStr,SqlConnection sc)
  2.         {
  3.             try
  4.             {
  5.                 var command = new SqlCommand()
  6.                                   {Connection = sc, CommandText = queryStr};
  7.                 var dataAdapter = new SqlDataAdapter() {SelectCommand = command};
  8.                 var dataTable = new System.Data.DataTable();
  9.                 dataAdapter.Fill(dataTable);
  10.                 return dataTable;
  11.             }
  12.             catch (Exception)
  13.             {
  14.                 throw;
  15.             }
  16.         }

No issues so far. What I want to know is if there's an easy to populate this dataTable into another schema using a different connection string. For the sake of this post, assume that there is a table with two columns
Create Table Student(StudentId int, StudentName varchar2(50));

I wish to fill this table with the dataTable that I have in the above code.

I could do it using a command Object and an insert statement. For example this code:
c# Code:
  1. static int LoadDataTable(OracleConnection oc, System.Data.DataTable dataTable)
  2.         {
  3.             try
  4.             {
  5.                 var command = new OracleCommand
  6.                                   {
  7.                                       CommandText = "INSERT INTO STUDENT (STUDENTID, STUDENTNAME) VALUES(:studentid, :studentname)",
  8.                                       CommandType = CommandType.TableDirect,
  9.                                       Connection = oc
  10.                                   };
  11.           var op1 = new OracleParameter
  12.                               {
  13.                                   ParameterName = "StudentId",
  14.                                   Size = 6,
  15.                                   OracleDbType = OracleDbType.Int,
  16.                                   Direction = System.Data.ParameterDirection.Input
  17.                               };
  18.                 command.Parameters.Add(op1);
  19.  
  20.                 var op2 = new OracleParameter
  21.                               {
  22.                                   ParameterName = "studentName",
  23.                                   OracleDbType = OracleDbType.Varchar2,
  24.                                   Size = 50,
  25.                                   Direction = System.Data.ParameterDirection.Input
  26.                               };
  27.                 command.Parameters.Add(op2);                                   
  28.                
  29.                 foreach (var row in dataTable.Rows)
  30.                 {
  31.                     command.Parameters("studentId").Value = int.Parse(row[0].ToString());
  32.                     command.Parameters("studentName").Value = row[1].ToString();
  33.                     command.ExecuteNonQuery();
  34.                 }    
  35.             }
  36.             catch(Exception)
  37.             {
  38.                 throw;
  39.             }
  40.            
  41.         }


Is there a quicker and easier way where I will have to loop through the records?