看access数据库中的时间字段是否和sql数据库的值相等 ,若不等 ,将access数据表里的fvalue字段数据取出放入Sql数据库表里,两个表fbl字段名都相同,
功能我做出来了,从sql数据库查询时,fvalue的值插进去了(有值),为什么打开数据库时没有显示呢,

解决方案 »

  1.   

    这是代码 private void DaoRu()  //
            {
                bool Result;
                DataSet ds = access.GetDataSet("select fvalue,fbl from t_syspara");         //Access数据库
                DataSet ds1 = sql.GetDataSet("select fvalue,fbl from sysparaTable");  
                //Sql数据库
                int len = ds.Tables[0].Rows.Count;
                int len1 = ds1.Tables[0].Rows.Count;
                //MessageBox.Show(len.ToString()); 
                if (ds.Tables[0].Rows[8][0] == ds1.Tables[0].Rows[9][0])
                {
                    return;
                }
                else
                {
                    int i = 0;
                    String tablename = "sysparaTable";
                    string fwhere = "where fbl=@fbl";
                    string[,] arParameters_Values_where = new string[1, 2];                //MessageBox.Show(s1);
                    string[,] arFieldName_Values = new string[1, 2];
                    while (i < len)
                    {                    arFieldName_Values[0, 0] = "fvalue";
                        arFieldName_Values[0, 1] = ds.Tables[0].Rows[i][0].ToString();                    arParameters_Values_where[0, 0] = "fbl";
                        arParameters_Values_where[0, 1] = ds.Tables[0].Rows[i][1].ToString(); ;                    Result = sql.ModifyRecord(tablename, arFieldName_Values, fwhere, arParameters_Values_where);
                        i++;                }
                    
                      
                }
            }