Source Code Example

static void Main(string[] args)
        {
            //string oldconnstr = "Data Source = 127.0.0.1:1521 / orcl; User ID = lrmjkj; Password = lrmjkj";
            //string newconnstr = "Data Source = 127.0.0.1:1521 / orcl; User ID = ZTFramework; Password = 123456";
            string oldconnstr = "Data Source=172.16.1.246:1521/orcl;User ID=GJJXT;Password=GJJXT;";
            string newconnstr = "Data Source=172.16.1.204:1521/orcl;User ID=hxgjj;Password=hxgjj;";
            DataTable dtOld = OracleClientHelper.ExecuteDataTable("select grm_xh,grm_fsje from yz_grmxb", new DbParameter[0], oldconnstr);
            foreach (DataRow dr in dtOld.Rows)
            {
                try
                {
                    //DbParameter[] param = new DbParameter[2];
                    //param[0] = new OracleParameter("@fse", Convert.ToString(dr["grm_fsje"]));
                    //param[1] = new OracleParameter("@xh", dr["grm_xh"].ToString());
                    OracleClientHelper.ExecuteNonQuery("update yz_grmxb set fse='" + dr["grm_fsje"].ToString() + "' where grm_xh='" + dr["grm_xh"].ToString() + "'", new DbParameter[0], newconnstr);
                }
                catch (Exception e)
                {
                    Console.WriteLine("编号为" + dr["grm_xh"].ToString() + " 的数据导入失败");
                }
            }
            Console.WriteLine("导入完毕");
            Console.ReadKey();
        }

 

Hi All!

MonthList

CommentList