日期:2014-05-17 浏览次数:20833 次
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (!(((Control)e.CommandSource).Parent.Parent is GridViewRow)) return;
GridViewRow row = (GridViewRow)((Control)e.CommandSource).Parent.Parent;
int id = Convert.ToInt32(GridView1.DataKeys[row.RowIndex].Value);
using (SqlConnection con = new SqlConnection(Common.ConnectionString))
{
string sql = string.Empty ;
if (e.CommandName == "fh")
{
//这里写update代码
}
}
}