dataSet1.Clear();
sqlDataAdapter1.Fill(dataSet1.Tables[tabel_name]);

解决方案 »

  1.   

    用数据适配器,
    编写其UpdateCommand属性。
    然后调用dataAdapter的Update()方法。
      

  2.   

    就是编写dataAdapter的UpdateCommand属性有点难,有没有例子!发一个过来看看!
    email:[email protected]就把编写dataAdapter的UpdateCommand属性的代码粘上来就可以了!谢谢!
      

  3.   

    SqlCommand cmd = new SqlCommand(strSql, con);cmd.Parameters.Add("@Type", SqlDbType.Decimal).Value = Type;objDataAdpter.UpdateCommand = cmd;
      

  4.   

    如下:
    SqlDataAdapter catDA = new SqlDataAdapter("SELECT CategoryID, CategoryName FROM Categories", nwindConn);       catDA.UpdateCommand = new SqlCommand("UPDATE Categories SET CategoryName = @CategoryName " +
                                         "WHERE CategoryID = @CategoryID" , nwindConn);catDA.UpdateCommand.Parameters.Add("@CategoryName", SqlDbType.NVarChar, 15, "CategoryName");SqlParameter workParm = catDA.UpdateCommand.Parameters.Add("@CategoryID", SqlDbType.Int);
    workParm.SourceColumn = "CategoryID";
    workParm.SourceVersion = DataRowVersion.Original;DataSet catDS = new DataSet();
    catDA.Fill(catDS, "Categories");   DataRow cRow = catDS.Tables["Categories"].Rows[0];
    cRow["CategoryName"] = "New Category";catDA.Update(catDS);
      

  5.   

    用System.Data.DataRowVersion来控制你要保存的datarow的版本