给你一个相类似的
DataView dv =(DataView)Session["shoukuanchaxun_kals_8008"];
int id =int.Parse(e.Item.Cells[8].Text);
dv.Sort="序号 desc";
int index =dv.Find(id);
shoukuanchaxun skcx =new shoukuanchaxun();
skcx.DeleteShouKuan(id);
dv.Delete(index);

解决方案 »

  1.   

    获取由主键值指定的行。以下示例使用数组的值在 DataRow 对象的集合中查找特定行。该方法假定 DataTable 具有三个主键列。在创建值的数组后,该代码使用 Find 方法和该数组获取所需的特定对象。
    private void FindInMultiPKey(DataTable myTable){
        DataRow foundRow;
        // Create an array for the key values to find.
        object[]findTheseVals = new object[3];
        // Set the values of the keys to find.
        findTheseVals[0] = "John";
        findTheseVals[1] = "Smith";
        findTheseVals[2] = "5 Main St.";
        foundRow = myTable.Rows.Find(findTheseVals);
        // Display column 1 of the found row.
        if(foundRow != null)
          Console.WriteLine(foundRow[1]);
     }
      

  2.   

    谢谢给位,尤其是 Knight94(愚翁),问题已经解决了。代码是没错。