Professional Web Applications Themes

DataList output is producing a blank table? - ASP.NET General

I am somewhat new to ASP.NET and I am probably overlooking some basic rule that's causing my error. Anyways, here's the scoop: I am using a DataReader to access a SQL stored procedure. I want the result set from the DataReader to be dumped into a DataList and displayed on the page. I already know that my data, the stored procedure, and the database connectivity all work correctly because I have outputted all this data to a dataGrid control. Now I am trying to output to a DataList control, and all I get is a blank browser screen. I don't ...

  1. #1

    Default DataList output is producing a blank table?

    I am somewhat new to ASP.NET and I am probably overlooking some basic
    rule that's causing my error. Anyways, here's the scoop: I am using
    a DataReader to access a SQL stored procedure. I want the result set
    from the DataReader to be dumped into a DataList and displayed on the
    page. I already know that my data, the stored procedure, and the
    database connectivity all work correctly because I have outputted all
    this data to a dataGrid control. Now I am trying to output to a
    DataList control, and all I get is a blank browser screen. I don't
    get any errors. And if I use my mouse to try and "highlight" the
    blank browser, I can see that there are some empty rows in a table
    structure. Looking at the source code in the browser, I see a table
    with 6 empty rows. This would make sense because my query should
    produce 6 records to be output. The HTML code is below, I just used
    the drag-and-drop editor to insert this DataList control:

    <asp:DataList id="dl" runat="server"></asp:DataList>

    The code-behind page with the necessary code is here (dl is the
    datalist control, dr is the datareader control, cn is the connection):

    'the connection string has already been set and is open
    Dim cmd4 As New System.Data.SqlClient.SqlCommand("spToddsRateTest" ,
    cn)
    cmd4.CommandType = CommandType.StoredProcedure
    dr = cmd4.ExecuteReader
    dl.DataSource = dr
    dl.DataBind()
    dr.Close()
    cn.Close()

    Any thoughts as to why this is producing a blank screen with no
    errors? The visible property is set to true.
    Todd Guest

  2. #2

    Default Re: DataList output is producing a blank table?

    [email]bacile99[/email] (Todd) wrote in message news:<eb84a9d1.0307241207.14ffc634posting.google. com>...
    > I am somewhat new to ASP.NET and I am probably overlooking some basic
    > rule that's causing my error. Anyways, here's the scoop: I am using
    > a DataReader to access a SQL stored procedure. I want the result set
    > from the DataReader to be dumped into a DataList and displayed on the
    > page. I already know that my data, the stored procedure, and the
    > database connectivity all work correctly because I have outputted all
    > this data to a dataGrid control. Now I am trying to output to a
    > DataList control, and all I get is a blank browser screen. I don't
    > get any errors. And if I use my mouse to try and "highlight" the
    > blank browser, I can see that there are some empty rows in a table
    > structure. Looking at the source code in the browser, I see a table
    > with 6 empty rows. This would make sense because my query should
    > produce 6 records to be output. The HTML code is below, I just used
    > the drag-and-drop editor to insert this DataList control:
    >
    > <asp:DataList id="dl" runat="server"></asp:DataList>
    >
    > The code-behind page with the necessary code is here (dl is the
    > datalist control, dr is the datareader control, cn is the connection):
    >
    > 'the connection string has already been set and is open
    > Dim cmd4 As New System.Data.SqlClient.SqlCommand("spToddsRateTest" ,
    > cn)
    > cmd4.CommandType = CommandType.StoredProcedure
    > dr = cmd4.ExecuteReader
    > dl.DataSource = dr
    > dl.DataBind()
    > dr.Close()
    > cn.Close()
    >
    > Any thoughts as to why this is producing a blank screen with no
    > errors? The visible property is set to true.
    Does anyone have a clue why I am not getting the data to output in my DataList?
    Todd Guest

  3. #3

    Default Re: DataList output is producing a blank table?

    You'll need to use ItemTemplate Tag
    <asp:DataList id="dl" runat="server">
    <itemTemplate>
    <%#DataBinder.Eval(Container.DataItem, "FieldName")%>
    </itemTemplate>
    </asp:DataList>

    HTH
    Regards
    Sushila
    ..NET MVP


    "Todd" <bacile99> wrote in message news:eb84a9d1.0307241207.14ffc634posting.google.c om...
    > I am somewhat new to ASP.NET and I am probably overlooking some basic
    > rule that's causing my error. Anyways, here's the scoop: I am using
    > a DataReader to access a SQL stored procedure. I want the result set
    > from the DataReader to be dumped into a DataList and displayed on the
    > page. I already know that my data, the stored procedure, and the
    > database connectivity all work correctly because I have outputted all
    > this data to a dataGrid control. Now I am trying to output to a
    > DataList control, and all I get is a blank browser screen. I don't
    > get any errors. And if I use my mouse to try and "highlight" the
    > blank browser, I can see that there are some empty rows in a table
    > structure. Looking at the source code in the browser, I see a table
    > with 6 empty rows. This would make sense because my query should
    > produce 6 records to be output. The HTML code is below, I just used
    > the drag-and-drop editor to insert this DataList control:
    >
    > <asp:DataList id="dl" runat="server"></asp:DataList>
    >
    > The code-behind page with the necessary code is here (dl is the
    > datalist control, dr is the datareader control, cn is the connection):
    >
    > 'the connection string has already been set and is open
    > Dim cmd4 As New System.Data.SqlClient.SqlCommand("spToddsRateTest" ,
    > cn)
    > cmd4.CommandType = CommandType.StoredProcedure
    > dr = cmd4.ExecuteReader
    > dl.DataSource = dr
    > dl.DataBind()
    > dr.Close()
    > cn.Close()
    >
    > Any thoughts as to why this is producing a blank screen with no
    > errors? The visible property is set to true.
    Sonali.NET[MVP] Guest

  4. #4

    Default Re: DataList output is producing a blank table?

    did u get the correct answer for this??



    Quote Originally Posted by Todd View Post
    I am somewhat new to ASP.NET and I am probably overlooking some basic
    rule that's causing my error. Anyways, here's the scoop: I am using
    a DataReader to access a SQL stored procedure. I want the result set
    from the DataReader to be dumped into a DataList and displayed on the
    page. I already know that my data, the stored procedure, and the
    database connectivity all work correctly because I have outputted all
    this data to a dataGrid control. Now I am trying to output to a
    DataList control, and all I get is a blank browser screen. I don't
    get any errors. And if I use my mouse to try and "highlight" the
    blank browser, I can see that there are some empty rows in a table
    structure. Looking at the source code in the browser, I see a table
    with 6 empty rows. This would make sense because my query should
    produce 6 records to be output. The HTML code is below, I just used
    the drag-and-drop editor to insert this DataList control:

    <asp:DataList id="dl" runat="server"></asp:DataList>

    The code-behind page with the necessary code is here (dl is the
    datalist control, dr is the datareader control, cn is the connection):

    'the connection string has already been set and is open
    Dim cmd4 As New System.Data.SqlClient.SqlCommand("spToddsRateTest" ,
    cn)
    cmd4.CommandType = CommandType.StoredProcedure
    dr = cmd4.ExecuteReader
    dl.DataSource = dr
    dl.DataBind()
    dr.Close()
    cn.Close()

    Any thoughts as to why this is producing a blank screen with no
    errors? The visible property is set to true.
    Unregistered Guest

Similar Threads

  1. about:blank - flash popup is blank
    By CStraubGo in forum Macromedia Flash Player
    Replies: 0
    Last Post: January 18th, 01:17 AM
  2. Generating table rows and columns in output?
    By Sir Fauntleroy in forum Macromedia ColdFusion
    Replies: 2
    Last Post: April 22nd, 05:17 PM
  3. Hiding a blank table cell
    By ASHLEYHAYWARD in forum Macromedia ColdFusion
    Replies: 0
    Last Post: April 7th, 10:27 AM
  4. Blank Paper Output with HP printer
    By farhaad webforumsuser@macromedia.com in forum Macromedia Director Lingo
    Replies: 2
    Last Post: August 12th, 11:19 AM
  5. GD is producing strange output from TTF fonts
    By aneusomy in forum PERL Modules
    Replies: 0
    Last Post: July 28th, 04:52 AM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139