I m working on asp.net i have 4 records in database
but grid is shwoing only one record here is my .aspx code
and here is code behind for page loadCode:<asp:datagrid id="DGProducts" runat="server" DataKeyField="product_id" CellPadding="3" BorderStyle="None" BorderColor="#E7E7FF" BackColor="White" AutoGenerateColumns="False"> ................................................... ..................... <asp:datagrid>
here is code behind for bindgrid methodCode: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
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


Reply With Quote
