Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old August 18th, 2004, 09:20 PM
Registered User
 
Join Date: Aug 2004
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default DataList Is not showing Data using ASP.NET and C#

I have to get data from a Oracle DB and show it based on the user input for Where clause.

I have created 2 DropDownList and populating them from DB using page_load method.

User picks up the desired value and clicks on the submit button.

Code behind the click event connects to the oracle using oleDb, generates sql, fills the DataSet and binds it to the DataList.

But no data, only the labels in template is showing up. However, if I use a DataGrid, it is showing the data.

Please help - this is my first form in .NET .

Thanks
Kmazumdar


Reply With Quote
  #2 (permalink)  
Old August 18th, 2004, 11:23 PM
Authorized User
 
Join Date: Aug 2004
Location: , , .
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

DataList ?
What i understand ur describes is U have a form that contain some textbox and dropdownlist, u have successful bind some data from db to the 2 dropdown list.

then when submit the data by click a button, it doesnt save into db but show the data on the grid only is it ?

is it asp.net or ???

~ Human Knowledge Belongs to the World !
Reply With Quote
  #3 (permalink)  
Old August 19th, 2004, 08:45 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,413
Thanks: 0
Thanked 16 Times in 16 Posts
Default

What does the markup for the DataList control look like?
Reply With Quote
  #4 (permalink)  
Old August 19th, 2004, 12:40 PM
Registered User
 
Join Date: Aug 2004
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Here is the markup for DataList
Code:
<asp:datalist id="DataList1" style="Z-INDEX: 110; LEFT: 133px; POSITION: absolute; TOP: 364px" runat="server" Width="539px" Height="92px" RepeatLayout=Flow>
                                <ItemTemplate>
                                    <TABLE>
                                        <tr>
                                            <td><b>NPA: </b>
                                                <asp:label id=lblNpa td < text='<%# DataBinder.Eval(Container.DataItem,"C1") %>'</td>
                                            <td><b>NXX: </b>
                                                <asp:label id="lblNxx" text='<%# DataBinder.Eval(Container.DataItem,"C2") %>' </td>
                                            <td><b>LATA: </b>
                                                <asp:label id="lblLata" text='<%# DataBinder.Eval(Container.DataItem,"C3") %>' </td>
                                        </tr>
                                        <tr>
                                            <td><b>Time Zone: </b>
                                                <asp:label id="lblTimeZone" text='<%# DataBinder.Eval(Container.DataItem,"C4") %>' </td>
                                            <td><b>Day Light Saving : </b>
                                                <asp:label id="lblDayLightSav" text='<%# DataBinder.Eval(Container.DataItem,"C5") %>' </td>
                                            <td><b>State Code: </b>
                                                <asp:label id="lblStateCd" text='<%# DataBinder.Eval(Container.DataItem,"C6") %>' </td>
                                        </tr>
                                        <tr>
                                            <td colspan="3"><b>Split From NPA: </b>
                                                <asp:label id="lblSplitFromNpa" text='<%# DataBinder.Eval(Container.DataItem,"C7") %>' </td>
                                        </tr>
                                        <tr>
                                            <td colspan="3"><b>Split From NXX: </b>
                                                <asp:label id="lblSplitFromNxx" text='<%# DataBinder.Eval(Container.DataItem,"C8") %>' </td>
                                        </tr>
                                        <tr>
                                            <td><b>Vertical Coordinate: </b>
                                                <asp:label id="lblVerticalCoordinate" text='<%# DataBinder.Eval(Container.DataItem,"C9") %>' </td>
                                            <td><b>Horizontal Coordinate : </b>
                                                <asp:label id="lblHorizontalCoordinate" text='<%# DataBinder.Eval(Container.DataItem,"C10") %>' </td>
                                            <td>&nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td colspan="3"><b>Border Town: </b>
                                                <asp:label id="lblBorderTown" text='<%# DataBinder.Eval(Container.DataItem,"C11") %>' </td>
                                        </tr>
                                    </TABLE>
                                </ItemTemplate>
                            </asp:datalist>

===================
Code behind the click event of submit button
===================
Code:
DataList1.DataSource = ds;
DataList1.DataBind();

Reply With Quote
  #5 (permalink)  
Old August 19th, 2004, 01:29 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,413
Thanks: 0
Thanked 16 Times in 16 Posts
Default

A) This line is incorrect:
<asp:label id=lblNpa td < text='<%# DataBinder.Eval(Container.DataItem,"C1") %>'</td>

B) None of your label's are "runat='server'". Add that and see what happens.
Reply With Quote
  #6 (permalink)  
Old August 20th, 2004, 11:18 AM
Registered User
 
Join Date: Aug 2004
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you.

I remove the label tag completely and it is working. However with 'runat"server"' directive, I was getting an error message saying Server directive not properly formed.

Thanks for all the help.

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Crystal not showing data tgraham Crystal Reports 4 September 9th, 2009 03:46 AM
IF condition in ASP.NET DataList surendran ASP.NET 3.5 Basics 1 October 31st, 2008 02:44 PM
Same data showing in PDF artarasan ASP.NET 2.0 Basics 1 July 3rd, 2007 02:10 AM
New Install of ASP.Net Won't Display DataList scott.ferguson ASP.NET 1.0 and 1.1 Basics 5 January 12th, 2007 05:21 AM
DataList ItemCommand event problem in ASP.NET page naidukap ASP.NET 1.0 and 1.1 Professional 0 December 26th, 2005 03:26 AM



All times are GMT -4. The time now is 06:52 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.