我必须从SQL Server中提取数据(某些特定字段而不是整个数据库)并将其转储到Oracle Client中。现在我已经能够使用SqlDataAdaptor和DataSet.But从SqlServer中提取数据了之后如何连接到Oracle将值插入Oracle数据库。
我见过链接服务器,但我的老板要我直接向oracle发送数据。 有人可以帮助我。
首先是 - >
的代码段SqlDataAdapter o_SQLDataAdaptor = new SqlDataAdapter("select TOP 10 POSITION_ID, POSITION_DESC from T_CD_POSITION", conn);
conn.Open();
//create and intialize a dataset object
DataSet o_ds_retrievedData = new DataSet();
//fill the data into dataset according to SQL query provided to adaptor
o_SQLDataAdaptor.Fill(o_ds_retrievedData, "T_CD_POSITION");
conn.Close();
//display results: loop through dataset as datarow object to present one row per loop
Console.WriteLine("Positon ids and description for the table RD2K");
Console.WriteLine("...............................................");
foreach (DataRow tempRow in o_ds_retrievedData.Tables["T_CD_POSITION"].Rows)
{
Console.WriteLine(tempRow["POSITION_ID"].ToString());
Console.WriteLine(tempRow["POSITION_DESC"].ToString());
}