--经过潜心单位修炼中有如下杰作慢慢看哇卡卡。
1.点击标题排序 2.分页






3编辑






4更新功能
// 更新(- -口水吧功能),设置了OnRowEditing="GridView1_RowEditing"。
protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
int id;
string xiaozhu;
// 下面得到主建
id = int.Parse(GridView1.Rows[e.RowIndex].Cells[0].Text);
//下面得到更新的内容
fxiaozhu; = ((TextBox)GridView1.Rows[e.RowIndex].Cells[1].Controls[0]).Text;
SqlConnection cnn = new SqlConnection("保密");
try
{
cnn.Open();
//这里写更新
SqlCommand cmd = new SqlCommand("保密")
cmd.ExecuteNonQuery();
}catch()
{
}
finally
{
cnn.Close();
}
GridView1.EditIndex = -1;
BindGrid();
}
protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
int id;
string xiaozhu;
// 下面得到主建
id = int.Parse(GridView1.Rows[e.RowIndex].Cells[0].Text);
//下面得到更新的内容
fxiaozhu; = ((TextBox)GridView1.Rows[e.RowIndex].Cells[1].Controls[0]).Text;
SqlConnection cnn = new SqlConnection("保密");
try
{
cnn.Open();
//这里写更新
SqlCommand cmd = new SqlCommand("保密")
cmd.ExecuteNonQuery();
}catch()
{
}
finally
{
cnn.Close();
}
GridView1.EditIndex = -1;
BindGrid();
}
5删除






































