kieky -2 Light Poster

hi, i really need your help..
this is my code.. BUT it just show 1 document.. what should i do to show all of document? can u correct my code? this is very urgent 4 me.. :'(

protected void GridView_Main_DataBind(int NewPageIndex)
    {
        string username = HttpContext.Current.User.Identity.Name;
        id_category = Convert.ToInt32(Request.QueryString[0]);
        DMSDataAccess db = new DMSDataAccess();

        Permission permission = db.DMSDataContext.Permissions.Where(p => p.UserName.Equals(username)).FirstOrDefault();
        string value = permission.UserName;
        int document = Convert.ToInt32(permission.IdDokumen);

        if (value != null)
        {
            var data = db.DMSDataContext.Dokumens.Select(p => p).Where(p => p.IdCategory == id_category && p.IdDokumen == document);            

            GridView_Main.PageSize = itemPerPage;
            GridView_Main.PageIndex = NewPageIndex;
            GridView_Main.DataSource = data;
            GridView_Main.DataBind();
        }
    }

please help me.. and thx before...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.