如果有自动ID,就以自动ID来删除;
如果没有自动ID,就用 ... where + 三个主键

解决方案 »

  1.   

    我知道,可是,我只取到第一个主键的值,方法如下:
    myCommand.Parameters.Add(new SqlParameter("@YHBH", SqlDbType.NVarChar, 18));
    myCommand.Parameters["@YHBH"].Value = DataGrid1.DataKeys[(int)e.Item.ItemIndex];
    第二个主键的值怎么取?
    有没有其它方法,可不可以给出代码,可加分
      

  2.   

    第一种,通过TextBox
    Response.Write(((TextBox)E.Item.FindControl("edit_LName")).Text);第二种 通过DataSource
    Response.Write(((DataView)MyDataGrid.DataSource).Table.Rows[E.Item.ItemIndex][1]);