Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 14th, 2007, 03:20 AM
Registered User
 
Join Date: Jun 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default display datagrid item

i want to display datagriditem.my code doesn't display item value.there is no any error.
here is my code:

If Not IsPostBack Then
 Dim conn As New OracleConnection
            conn = New OracleConnection(str)
            conn.Open()

            Dim adp As New OracleDataAdapter _
            (sql_str2, conn)
            Dim ds As Data.DataSet = New Data.DataSet
            adp.Fill(ds, "ho_store_master")
            DataGrid1.DataSource = ds.Tables("ho_store_master")
            DataGrid1.DataBind()

 End If

 Protected Sub DataGrid1_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles DataGrid1.ItemDataBound
        If Not IsPostBack Then

            Dim dgitem As DataGridItem
            Dim s,c As String
            For Each dgitem In DataGrid1.Items
                s = dgitem.Cells(0).Text()
                c=e.item.cells(1).text
                Response.Write(s)
            Next

        End If

    End Sub

Please help

 
Old July 16th, 2007, 07:47 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

hello there..

why are you executing something in the databound event of the grid?? to check is there is some data??

why not just debug the code, stop it when you load the grid and check if the table that you are getting has data??

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========





Similar Threads
Thread Thread Starter Forum Replies Last Post
Sort by date...select....display first item prob athos XSLT 2 November 3rd, 2008 04:31 PM
sort and display first item only athos XSLT 11 October 16th, 2008 01:10 PM
Display data as per combobox item selected yogeshyl Excel VBA 0 July 28th, 2007 06:17 AM
Tab item display prob / hide TABS query socoolbrewster CSS Cascading Style Sheets 4 June 13th, 2006 12:59 PM
Datagrid - selected item display advice janetb ASP.NET 1.0 and 1.1 Basics 2 May 9th, 2006 02:56 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.