Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
|
ADO.NET For discussion about ADO.NET.  Topics such as question regarding the System.Data namespace are appropriate.  Questions specific to a particular application should be posted in a forum specific to the application .
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ADO.NET 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 August 7th, 2003, 05:59 PM
Authorized User
 
Join Date: Aug 2003
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default Datalist does not display data

I am trying to display data from a database using a datalist. I don't get and error messages. The data just does not get displayed. Could you tell me what's wrong with my code?

---------------------------------------------------------------------------------------
This is my data connection:
<Script runat="server">
        Sub Page_Load

        'Establish Connection
        Dim myDS As New DataSet()
        Dim myConnection As New SqlConnection
        Dim SQLServer As String = "server=localhost;database=AIA;Trusted_Connection= yes"
        Dim DataConn as SQLConnection
        Dim dbCommand As SQLCommand
        DataConn = new SQLConnection(SQLServer)

        'Call store procedure to poulate datalist
        Dim mySqlDA As New SqlDataAdapter("sp_DisplayCommiteeInfornation",Dat aConn)

        mySqlDA.Fill(myDS)
        CommiteeList.DataSource = myDS
        CommiteeList.Databind()
        End Sub
        </Script>
-----------------------------------------------------------------------------
This is the datalis displaying the data:

                    <asp:datalist ID="CommiteeList" RepeatColumns="3"
                    gridlines="Both" CellPadding="5" Runat="server">
                    <ItemTemplate>
                    <b>Title</b>
                        <%# DataBinder.Eval(Container.DataItem, "Title")%>
                    <br>
                    <b>Name</b>
                        <%# DataBinder.Eval(Container.DataItem, "Name")%>
                    <br>
                    <b>Email</b>
                        <%# DataBinder.Eval(Container.DataItem, "Email")%>
                    <br>
                    <b>Phone</b>
                        <%# DataBinder.Eval(Container.DataItem, "Phone")%>
                    </ItemTemplate>
                    </asp:datalist>

Sanjeet
__________________
Sanjeet
 
Old August 8th, 2003, 11:26 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

set DataMember for ut list!

Always:),
Hovik Melkomian.





Similar Threads
Thread Thread Starter Forum Replies Last Post
datalist display almotions ASP.NET 2.0 Basics 1 February 18th, 2008 03:19 AM
unable to display my datalist frresh C# 2005 0 November 14th, 2006 11:52 AM
How To Display Images in DataList abdul_owiusa General .NET 4 June 3rd, 2005 11:49 AM
How To Display Images in DataList abdul_owiusa General .NET 1 May 20th, 2005 09:01 AM





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