调用了 Page.DataBind()方法了没有?

解决方案 »

  1.   

    没有,我现在在加在
        Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            '在此处放置初始化页的用户代码
            Page.DataBind()
        End Sub
    但还是不行。
      

  2.   


    datagrid.datasource=a["dbname"]
    Page.DataBind()
      

  3.   

    private bool BindLyData()
    {
    SqlConnection sqlconnly=new SqlConnection("Server=192.168.50.10;uid=rsgl;pwd=tangjun;database=tc");
    SqlDataAdapter sqladply=new SqlDataAdapter ("select * from ly",sqlconnly);
    dsLy.Clear();
    sqladply.Fill(dsLy,"ly");
    this.DgLy.DataSource=dsLy;
    this.DgLy.DataBind();
    int pagecount=this.DgLy.PageCount;
    this.DgLy.CurrentPageIndex =pagecount-1;
    this.DataBind();
    return true;
    }