从Sql Server取数据到DataSet,再插入Oracle的表

C# code
  
<!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --> public void CreateCmdsAndUpdate(DataSet myDataSet)
{
            OracleConnection myConn = new OracleConnection(myConnection); 
OracleDataAdapter myDataAdapter
= new OracleDataAdapter();
myDataAdapter.SelectCommand
= new OracleCommand(mySelectQuery, myConn);
OracleCommandBuilder custCB
= new OracleCommandBuilder(myDataAdapter);
myConn.Open();
DataTable dt
= myDataSet.Tables[0];
foreach(DataRow dr in dt.Rows)
{
dr.SetAdded();
//.net 2.0中新增的SetAdd()方法,1.1中没有
}
myDataAdapter.Update(dt);
myConn.Close();
}

你可能感兴趣的:(SQL Server)