本帖最后由 xu345713970 于 2012-07-31 20:40:33 编辑

解决方案 »

  1.   

    public int UpdateByDataSet(DataSet ds,string strTblName,string strConnection)
    {
       try
      {
       SqlConnection  conn = new SqlConnection(strConnection));
       SqlDataAdapter myAdapter = new SqlDataAdapter();
       SqlCommand myCommand = new SqlCommand("select * from "+strTblName),(SqlConnection)this.conn);   
       myAdapter.SelectCommand = myCommand;
       SqlCommandBuilder myCommandBuilder = new SqlCommandBuilder(myAdapter);    
       myAdapter.Update(ds,strTblName); 
       return 0;
      }
      catch(BusinessException errBU)
      { 
       throw errBU;
      }  
      catch(Exception err)
      { 
       throw new BusinessException(err);
      }
    }
      

  2.   

    http://topic.csdn.net/u/20120609/16/57729ce3-fe64-425f-bd3d-1a84695e9ba3.html