Results 1 to 2 of 2

Thread: [RESOLVED] Datagrid showing just one record

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2007
    Location
    Karachi
    Posts
    551

    Resolved [RESOLVED] Datagrid showing just one record

    I m working on asp.net i have 4 records in database

    but grid is shwoing only one record here is my .aspx code

    Code:
    	<asp:datagrid id="DGProducts" runat="server" DataKeyField="product_id" CellPadding="3" BorderStyle="None"
    							BorderColor="#E7E7FF" BackColor="White" AutoGenerateColumns="False">
    					
    ...................................................
    .....................
    
    <asp:datagrid>
    and here is code behind for page load
    Code:
     Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            ' If Not IsPostBack Then
            bindgrid()
            ' End If
            
        End Sub
    here is code behind for bindgrid method
    Code:
      Private Sub bindgrid()
            Try
                '  If Not IsPostBack Then
                Dim dsProduct As New DataSet
                dsProduct = cn.SelectQueryDS("Select * from admin", HttpContext.Current.Server.MapPath("../database/urban.mdb"))
                Response.Write(dsProduct.Tables(0).Rows.Count)
                If dsProduct.Tables(0).Rows.Count > 0 Then
                    DGProducts.DataSource = dsProduct
                    DGProducts.DataBind()
                End If
                '   End If
            Catch ex As Exception
    
            End Try
        End Sub

    where this statemnet shows Response.Write(dsProduct.Tables(0).Rows.Count) shows 4 record

    any urgent help would be higly appreciated

  2. #2

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2007
    Location
    Karachi
    Posts
    551

    Re: Datagrid showing just one record

    OK .my problem has been resolves .I edit hyperlink column and every thing works fine

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width