一组查询后得到的DataGrid数据,如何从第一行更新到最后一行??急求代码!!!

解决方案 »

  1.   

    你在你的更新查询事件写下面的话就可以了
    strSql = "select State,Infotitle,Infocontent,Infotime,Disposetime,DisposeInfo,InfoessueID from T_Info where Infotime between '"+strFrom+"'and '"+ strTo +"'and State='"+ strDispo +"'";
      mySQL.Bind_DG(DG_info,strSql);
    static public void Bind_DG(System.Web.UI.WebControls.DataGrid dg,string strSql)
    {
    SqlConnection conn = new SqlConnection(strConn);
    conn.Open();
    SqlDataAdapter da = new SqlDataAdapter(strSql,conn);
    DataSet ds = new DataSet();
    da.Fill(ds);
    dg.DataSource = ds.Tables[0].DefaultView;
    dg.DataBind();
    conn.Close();
    }
      

  2.   

    http://blog.csdn.net/langmafeng/archive/2004/07/02/32287.aspx