额 网页程序
  就是怎么在GridView编辑完成后点击更新后怎么将数据更新到数据库中?目前的难题是怎么将更新的那行的数据得到(---)
或者有什么可以直接调用来实现更新操作?PS:
GridView当年没学好  = =!

解决方案 »

  1.   

    百度一下GridView 72,有好多关于GridView的用法
      

  2.   

    在你更新了本地数据(就是edit编辑完之后) 你可以在重新绑定数据源
      

  3.   

    获取更新哪行的数据GridView1.Rows[e.RowIndex]
      

  4.   

    貌似我应该结贴了 谢谢各位的回答下面是我的处理开始我用string str1 = ((TextBox)(GridView1.Rows[e.RowIndex].Cells[7].Controls[0])).Text.ToString().Trim();来获取结果 但是不会成功  总是获取空的数据,
     然后我想应该是在获取数据的时候出了点问题后来将Grideview的一个属性
    EnableViewState=false 设置为假 的时候就成功获取了 下面贴一些处理代码希望对有同样问题的有点帮助(虽然貌似画蛇添足) protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
           //需要将GridView的属性EnableViewState=false
            string constr = ConfigurationManager.ConnectionStrings["xm_data_DataConnectionString"].ConnectionString;
            SqlConnection cn = new SqlConnection(constr);
            string str1 = ((TextBox)(GridView1.Rows[e.RowIndex].Cells[7].Controls[0])).Text.ToString().Trim();
            string strid = ((TextBox)(GridView1.Rows[e.RowIndex].Cells[12].Controls[0])).Text.ToString().Trim();
            string textcommd = "update kyhlxk set 审核提示='" + str1 + "' where id=" + Convert.ToInt32(strid);
            SqlCommand upcommd = new SqlCommand(textcommd, cn);
            cn.Open();
            upcommd.ExecuteNonQuery();
            cn.Close();
            Label1.Text = textcommd;
            GridView1.EditIndex = -1;//编辑状态取消
            gradeview();//是我重新填充Grideview的函数
        }
    令:我的提示来自:http://blog.csdn.net/21aspnet/archive/2007/03/25/1540301.aspx
    感谢1楼提示