关于第二个问题,你可以把整个类保存在Session中,不过耗内存。
第一个问题,我估计你要说清楚点别人才能看得懂。

解决方案 »

  1.   

    用户有时却看见的不是指定的sql语句读出的记录。看到不应该看到的记录,这是什么原因,怎样解决??
    sql语句有问题
      

  2.   

    先检查一下你的datatable或dataset
      

  3.   

    1,分页的时候看看你
    Binder的DataSource对不对??(不知道你的具体要求是什么)
    2,记录用户登陆信息一般用Session或则Cookies来做就可以了。还有Session有一个超时问题,
    建议你用Cookie好了。
      

  4.   

    下面是我填充代码,在一个button事件里:
    private void Button1_Click(object sender, System.EventArgs e)
    {
         this.DataGrid1.Dispose();                
         DataGrid1.EditItemIndex = -1;
         this.DataGrid1.CurrentPageIndex=0;
    int num=CheckBoxList1.Items.Count;
    int checkbox=0;
    for(int i=0;i<num;i++)
    {
    if(CheckBoxList1.Items[i].Selected==true)
    {
    checkbox++;
    }
    }
    if(checkbox==1)
    { this.Label1.Text=this.CheckBoxList1.SelectedItem.Text; this.Label2.Text=this.CheckBoxList1.SelectedItem.Value; strSend="select id,mobile,name,[group] as zhu from corp_group_member where [group]='"+Label1.Text+"' and fmobile='"+Label2.Text+"' order by id desc";
    ds=lsqdata.dbbind(strSend);             //lsqdata.dbbind()返回一个数据集
    this.DataGrid1.DataSource=ds.Tables["mytable"].DefaultView;
    this.DataGrid1.DataBind();
    this.Label3.Text="当前组名:"+Label1.Text+"    共有:"+ds.Tables["mytable"].Rows.Count.ToString()+"条记录";
    }
    else
    {
    Response.Write("<script>alert('一次只能选取一个部门!')</script>");
    }
    }用户可能不断变换CheckBoxList1里选定内容,所以这样会不会出现ds里的混乱,导致datagrid里出现数据错误?
      

  5.   

    你必须保证每次更新时能够重新正确的填充Datagrid,你试着把这段代码分离出来单独跟踪一下。