-
C# code
-
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取数据到DataSet,再插入Oracle的表
最新推荐文章于 2021-04-03 11:36:33 发布