attipa
asked on
trying to fill in a nested datalist with 1 sqldatareader
i have the following code behind:
-------------------------- ------
Private Sub bloglist_ItemDataBound(ByV al sender As Object, ByVal e As System.Web.UI.WebControls. DataListIt emEventArg s) Handles bloglist.ItemDataBound
If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingIt em Then
Dim blogreader As SqlDataReader
Dim commentreader As SqlDataReader
Dim blogID As String
Dim blogs As New Blog
Dim blogimagelist As System.Web.UI.WebControls. DataList = DirectCast(e.Item.FindCont rol("blogi magelist") , System.Web.UI.WebControls. DataList)
blogID = DataBinder.Eval(e.Item.Dat aItem, "BlogID").ToString()
blogreader = blogs.GetBlogbyID(blogID)
If blogreader.Read() Then
BindCategories(categorylis t, blogID)
categorylist.Visible = True
FiledUnderLabel.Visible = True
FiledUnderExtraSpace.Visib le = True
datepostedforblog.Text = Format(CDate(blogreader("D ateAdded") ), "MMMM dd, yyyy")
If Not blogreader("Picture1") = "0" Then
Dim Picture1URL As String
If blogreader("Picture1") = blogreader("ImageID") Then
Picture1URL = blogreader("URL")
mainblogimage.ImageUrl = "../admin-createblogmainim age.aspx?f ilename=.. /BlogImage s/" + Picture1URL + "&width=250"
mainblogimage.Visible = True
End If
Else
mainblogimage.Visible = False
End If
If Not blogreader("Picture2") = "0" Then
blogimagelist.Visible = True
blogimagelist.DataSource = blogreader("URL")
blogimagelist.DataKeyField = "ImageID"
blogimagelist.DataBind()
End If
Else
categorylist.Visible = False
FiledUnderLabel.Visible = False
FiledUnderExtraSpace.Visib le = False
End If
commentreader = comment.GetComments(blogID )
If commentreader.Read() Then
commentcounter += 1
End If
CommentsCountNumber.Text = "VENTING ROOM (" + commentcounter.ToString() + ")"
CommentsCountNumber.Naviga teUrl = "../blog-detail.aspx?BlogI D=" + blogID
blogreader.Close()
End If
End Sub
-------------------------- ---------- ---
the following is the stored procedure:
-------------------------- ---------- ---------
CREATE PROCEDURE GetBlogbyID
(@BlogID int)
AS
Select Blog.BlogID, Headline, [Text], Blog.DateAdded, Picture1, Picture2, Picture3, Picture4, Picture5, Picture6, Picture7, Picture8, Category1, Category2, Category3, Category4, Category5, Category6, Category7, Category8, Category.[Name], Category.CategoryID, CommentID, Comment.DateAdded, UserName, UserEmail, UserURL, [Image].ImageID, URL
From Blog Inner JOIN Category
ON Category.CategoryID = Blog.Category1 OR Category.CategoryID = Blog.Category2 OR Category.CategoryID = Blog.Category3 OR Category.CategoryID = Blog.Category4 OR Category.CategoryID = Blog.Category5 OR Category.CategoryID = Blog.Category6 OR Category.CategoryID = Blog.Category7 OR Category.CategoryID = Blog.Category8
Left Join Comment
On Comment.BlogID = Blog.BlogID
Left Join [Image]
On [Image].ImageID = Blog.Picture1 OR [Image].ImageID = Blog.Picture2 OR [Image].ImageID = Blog.Picture3 OR [Image].ImageID = Blog.Picture4 OR [Image].ImageID = Blog.Picture5 OR [Image].ImageID = Blog.Picture6 OR [Image].ImageID = Blog.Picture7 OR [Image].ImageID = Blog.Picture8
Where Blog.BlogID = @BlogID AND Category.CategoryID <> 7 AND [Image].ImageID <> 0
ORDER BY
Case
WHEN [Image].ImageID = Blog.Picture1 THEN 1
WHEN [Image].ImageID = Blog.Picture2 THEN 2
WHEN [Image].ImageID = Blog.Picture3 THEN 3
WHEN [Image].ImageID = Blog.Picture4 THEN 4
WHEN [Image].ImageID = Blog.Picture5 THEN 5
WHEN [Image].ImageID = Blog.Picture6 THEN 6
WHEN [Image].ImageID = Blog.Picture7 THEN 7
WHEN [Image].ImageID = Blog.Picture8 THEN 8
ELSE 10
END
Return
GO
-------------------------- ---------- ------
when the aspx page is loaded, I get the following error:
DataBinder.Eval: 'System.Char' does not contain a property with the name ImageID.
WHY?
the sql stored procedure returns all the information perfectly
--------------------------
Private Sub bloglist_ItemDataBound(ByV
If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingIt
Dim blogreader As SqlDataReader
Dim commentreader As SqlDataReader
Dim blogID As String
Dim blogs As New Blog
Dim blogimagelist As System.Web.UI.WebControls.
blogID = DataBinder.Eval(e.Item.Dat
blogreader = blogs.GetBlogbyID(blogID)
If blogreader.Read() Then
BindCategories(categorylis
categorylist.Visible = True
FiledUnderLabel.Visible = True
FiledUnderExtraSpace.Visib
datepostedforblog.Text = Format(CDate(blogreader("D
If Not blogreader("Picture1") = "0" Then
Dim Picture1URL As String
If blogreader("Picture1") = blogreader("ImageID") Then
Picture1URL = blogreader("URL")
mainblogimage.ImageUrl = "../admin-createblogmainim
mainblogimage.Visible = True
End If
Else
mainblogimage.Visible = False
End If
If Not blogreader("Picture2") = "0" Then
blogimagelist.Visible = True
blogimagelist.DataSource = blogreader("URL")
blogimagelist.DataKeyField
blogimagelist.DataBind()
End If
Else
categorylist.Visible = False
FiledUnderLabel.Visible = False
FiledUnderExtraSpace.Visib
End If
commentreader = comment.GetComments(blogID
If commentreader.Read() Then
commentcounter += 1
End If
CommentsCountNumber.Text = "VENTING ROOM (" + commentcounter.ToString() + ")"
CommentsCountNumber.Naviga
blogreader.Close()
End If
End Sub
--------------------------
the following is the stored procedure:
--------------------------
CREATE PROCEDURE GetBlogbyID
(@BlogID int)
AS
Select Blog.BlogID, Headline, [Text], Blog.DateAdded, Picture1, Picture2, Picture3, Picture4, Picture5, Picture6, Picture7, Picture8, Category1, Category2, Category3, Category4, Category5, Category6, Category7, Category8, Category.[Name], Category.CategoryID, CommentID, Comment.DateAdded, UserName, UserEmail, UserURL, [Image].ImageID, URL
From Blog Inner JOIN Category
ON Category.CategoryID = Blog.Category1 OR Category.CategoryID = Blog.Category2 OR Category.CategoryID = Blog.Category3 OR Category.CategoryID = Blog.Category4 OR Category.CategoryID = Blog.Category5 OR Category.CategoryID = Blog.Category6 OR Category.CategoryID = Blog.Category7 OR Category.CategoryID = Blog.Category8
Left Join Comment
On Comment.BlogID = Blog.BlogID
Left Join [Image]
On [Image].ImageID = Blog.Picture1 OR [Image].ImageID = Blog.Picture2 OR [Image].ImageID = Blog.Picture3 OR [Image].ImageID = Blog.Picture4 OR [Image].ImageID = Blog.Picture5 OR [Image].ImageID = Blog.Picture6 OR [Image].ImageID = Blog.Picture7 OR [Image].ImageID = Blog.Picture8
Where Blog.BlogID = @BlogID AND Category.CategoryID <> 7 AND [Image].ImageID <> 0
ORDER BY
Case
WHEN [Image].ImageID = Blog.Picture1 THEN 1
WHEN [Image].ImageID = Blog.Picture2 THEN 2
WHEN [Image].ImageID = Blog.Picture3 THEN 3
WHEN [Image].ImageID = Blog.Picture4 THEN 4
WHEN [Image].ImageID = Blog.Picture5 THEN 5
WHEN [Image].ImageID = Blog.Picture6 THEN 6
WHEN [Image].ImageID = Blog.Picture7 THEN 7
WHEN [Image].ImageID = Blog.Picture8 THEN 8
ELSE 10
END
Return
GO
--------------------------
when the aspx page is loaded, I get the following error:
DataBinder.Eval: 'System.Char' does not contain a property with the name ImageID.
WHY?
the sql stored procedure returns all the information perfectly
ASKER
its a dataset...everything works perfect until it gets to the part of blogimagelist.datakeyfield
I believe your problem is not in your code-behind but in your ASPX page.. can you show us that code? Your error is attempting to extract the ImageID column out of a Character (System.Char) object... which is very odd. But it appears to be happening elsewhere than what you've shown.
-- Jason
-- Jason
ASKER
<asp:datalist id="bloglist" Runat="server" HorizontalAlign="Left" RepeatDirection="Vertical" RepeatColumns="1">
<ItemTemplate>
<div style="border-style: double; border-color: white; padding-top: 2px; padding-bottom: 2px; padding-left: 2px; padding-right: 2px">
<table width="450" cellpadding="8" cellspacing="0" bgcolor="#FFFFFF" border="0">
<tr>
<td align="center" valign="center">
<table width="100%" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" border="0">
<tr>
<td align="left" valign="top">
<font class="blog-list-headline" >
<a class="blog-list-headline" href="../blog-detail.aspx? BlogID=<%# DataBinder.Eval(Container. DataItem, "BlogID") %>"><%# DataBinder.Eval(Container. DataItem, "Headline") %></a><br>
</font>
</td>
</tr>
<tr>
<td align="left" valign="top">
<div style="float: left; padding-left: 10px; height: 20px">
<font class="blog-list-posteddat e">
Posted: <asp:Label ID="datepostedforblog" Runat="server" CssClass="blog-list-posted date"></as p:Label>
</font>
</div>
</td>
</tr>
<tr>
<td id="categorycell" align="left" valign="top">
<div style="float: left; width: 90px; padding-left: 15px">
<asp:Label ID="FiledUnderLabel" Runat="server" CssClass="blog-list-catego ry">Filed under:</asp:Label>
</div>
<div>
<asp:datalist id="categorylist" RepeatColumns="3" RepeatDirection="Horizonta l" HorizontalAlign="Left"
Runat="server" Visible="False">
<ItemTemplate>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="left" valign="top">
<asp:HyperLink ID="categorylink" Runat="server" CssClass="blog-list-catego ry">
<a class="blog-list-category" href="../category-detail.a spx?catego ryID=<%# DataBinder.Eval(Container. DataItem, "CategoryID") %>"><%# DataBinder.Eval(Container. DataItem, "Name") %></a>
</asp:HyperLink>
</td>
</tr>
</table>
</ItemTemplate>
<SeparatorTemplate>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="left" valign="top">
<font class="blog-list-category" > &nb sp;| </fo nt>
</td>
</tr>
</table>
</SeparatorTemplate>
</asp:datalist>
</div>
</td>
</tr>
<tr>
<td align="center" valign="top">
<asp:Label ID="FiledUnderExtraSpace" Runat="server" CssClass="blog-list-text"> <br></asp: Label>
<asp:Image ID="mainblogimage" Visible="False" Runat="server" />
</td>
</tr>
<tr>
<td align="left" valign="top">
<font class="blog-list-text">
<%# DataBinder.Eval(Container. DataItem, "Text") %>
<br>
</font>
</td>
</tr>
<tr>
<td align="left" valign="top" ID="picturescell" runat="server">
<asp:datalist id="blogimagelist" RepeatColumns="4" RepeatDirection="Horizonta l" HorizontalAlign="Left"
Runat="server" Visible="False">
<ItemTemplate>
<table width="100" height="100" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="middle">
<a onclick="MyWindow=window.o pen('../im age-detail .aspx?Imag eID=<%# DataBinder.Eval(Container. DataItem, "ImageID") %>','MyWindow','toolbar=no ,location= no,directo ries=no,st atus=no,me nubar=no,s crollbars= no,resizab le=yes,wid th=600,hei ght=700,le ft=10,top= 10'); return false;" href="#"><img src='../admin-createthumbn ail.aspx?f ilename=.. /BlogImage s/<%# DataBinder.Eval(Container. DataItem, "URL") %>&width=100' border="0"></a>
</td>
</tr>
</table>
</ItemTemplate>
<SeparatorTemplate>
<table width="5" cellpadding="0" cellspacing="0" border="0">
<tr>
<td align="center" valign="middle">
<font class="blog-list-headline" >
<br>
<br>
</font>
</td>
</tr>
</table>
</SeparatorTemplate>
</asp:datalist>
</td>
</tr>
<tr>
<td align="right" valign="top">
<font class="blog-list-comments- label">
<asp:hyperlink ID="CommentsCountNumber" CssClass="blog-list-commen ts-label" Runat="server"></asp:hyper link>
<br>
</font>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</ItemTemplate>
<SeparatorTemplate>
<div style="padding-top: 2px; padding-bottom: 2px; padding-left: 2px; padding-right: 2px">
<table width="450" cellpadding="0" cellspacing="0" border="0">
<tr>
<td align="center" valign="top">
<font class="blog-list-headline" >
<br>
<hr width="90%">
<br>
</font>
</td>
</tr>
</table>
</div>
</SeparatorTemplate>
</asp:datalist>
<ItemTemplate>
<div style="border-style: double; border-color: white; padding-top: 2px; padding-bottom: 2px; padding-left: 2px; padding-right: 2px">
<table width="450" cellpadding="8" cellspacing="0" bgcolor="#FFFFFF" border="0">
<tr>
<td align="center" valign="center">
<table width="100%" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" border="0">
<tr>
<td align="left" valign="top">
<font class="blog-list-headline"
<a class="blog-list-headline"
</font>
</td>
</tr>
<tr>
<td align="left" valign="top">
<div style="float: left; padding-left: 10px; height: 20px">
<font class="blog-list-posteddat
Posted: <asp:Label ID="datepostedforblog" Runat="server" CssClass="blog-list-posted
</font>
</div>
</td>
</tr>
<tr>
<td id="categorycell" align="left" valign="top">
<div style="float: left; width: 90px; padding-left: 15px">
<asp:Label ID="FiledUnderLabel" Runat="server" CssClass="blog-list-catego
</div>
<div>
<asp:datalist id="categorylist" RepeatColumns="3" RepeatDirection="Horizonta
Runat="server" Visible="False">
<ItemTemplate>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="left" valign="top">
<asp:HyperLink ID="categorylink" Runat="server" CssClass="blog-list-catego
<a class="blog-list-category"
</asp:HyperLink>
</td>
</tr>
</table>
</ItemTemplate>
<SeparatorTemplate>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="left" valign="top">
<font class="blog-list-category"
</td>
</tr>
</table>
</SeparatorTemplate>
</asp:datalist>
</div>
</td>
</tr>
<tr>
<td align="center" valign="top">
<asp:Label ID="FiledUnderExtraSpace" Runat="server" CssClass="blog-list-text">
<asp:Image ID="mainblogimage" Visible="False" Runat="server" />
</td>
</tr>
<tr>
<td align="left" valign="top">
<font class="blog-list-text">
<%# DataBinder.Eval(Container.
<br>
</font>
</td>
</tr>
<tr>
<td align="left" valign="top" ID="picturescell" runat="server">
<asp:datalist id="blogimagelist" RepeatColumns="4" RepeatDirection="Horizonta
Runat="server" Visible="False">
<ItemTemplate>
<table width="100" height="100" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="middle">
<a onclick="MyWindow=window.o
</td>
</tr>
</table>
</ItemTemplate>
<SeparatorTemplate>
<table width="5" cellpadding="0" cellspacing="0" border="0">
<tr>
<td align="center" valign="middle">
<font class="blog-list-headline"
<br>
<br>
</font>
</td>
</tr>
</table>
</SeparatorTemplate>
</asp:datalist>
</td>
</tr>
<tr>
<td align="right" valign="top">
<font class="blog-list-comments-
<asp:hyperlink ID="CommentsCountNumber" CssClass="blog-list-commen
<br>
</font>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</ItemTemplate>
<SeparatorTemplate>
<div style="padding-top: 2px; padding-bottom: 2px; padding-left: 2px; padding-right: 2px">
<table width="450" cellpadding="0" cellspacing="0" border="0">
<tr>
<td align="center" valign="top">
<font class="blog-list-headline"
<br>
<hr width="90%">
<br>
</font>
</td>
</tr>
</table>
</div>
</SeparatorTemplate>
</asp:datalist>
ASKER
scolja,
any suggestions? please help me out on this..I am stuck and have no clue as to what to do.
any suggestions? please help me out on this..I am stuck and have no clue as to what to do.
attipa,
I'm not seeing it.. try commenting out the blogimagelist.datakeyfield line, which you say is the line causing the error and see what happens... let's start debugging this and see what comes of it.. you only have a few references to the ImageID... hopefully it can't be too difficult to find. But the error you posted appears to be with the DataBinder.Eval(Container. DataItem, "ImageID") line... so maybe try removing that and seeing what happens...
<a onclick="MyWindow=window.o pen('../im age-detail .aspx?Imag eID=<%# DataBinder.Eval(Container. DataItem, "ImageID") %>','MyWindow','toolbar=no ,location= no,directo ries=no,st atus=no,me nubar=no,s crollbars= no,resizab le=yes,wid th=600,hei ght=700,le ft=10,top= 10'); return false;" href="#"><img src='../admin-createthumbn ail.aspx?f ilename=.. /BlogImage s/<%# DataBinder.Eval(Container. DataItem, "URL") %>&width=100' border="0"></a>
-- Jason
I'm not seeing it.. try commenting out the blogimagelist.datakeyfield
<a onclick="MyWindow=window.o
-- Jason
ASKER
This is the part of the code behind
--------------------------
If Not blogreader("Picture2") = "0" Then
blogimagelist.Visible = True
blogimagelist.DataSource = blogreader("URL")
blogimagelist.DataKeyField = "ImageID"
blogimagelist.DataBind()
End If
This is the nested datalist:
-------------------------- ---------
<asp:datalist id="blogimagelist" RepeatColumns="4" RepeatDirection="Horizonta l" HorizontalAlign="Left"
Runat="server" Visible="False">
<ItemTemplate>
<table width="100" height="100" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="middle">
<a onclick="MyWindow=window.o pen('../im age-detail .aspx?Imag eID=<%# DataBinder.Eval(Container. DataItem, "ImageID") %>','MyWindow','toolbar=no ,location= no,directo ries=no,st atus=no,me nubar=no,s crollbars= no,resizab le=yes,wid th=600,hei ght=700,le ft=10,top= 10'); return false;" href="#"><img src='../admin-createthumbn ail.aspx?f ilename=.. /BlogImage s/<%# DataBinder.Eval(Container. DataItem, "URL") %>&width=100' border="0"></a>
</td>
</tr>
</table>
</ItemTemplate>
<SeparatorTemplate>
<table width="5" cellpadding="0" cellspacing="0" border="0">
<tr>
<td align="center" valign="middle">
<font class="blog-list-headline" >
<br>
<br>
</font>
</td>
</tr>
</table>
</SeparatorTemplate>
</asp:datalist>
--------------------------
If Not blogreader("Picture2") = "0" Then
blogimagelist.Visible = True
blogimagelist.DataSource = blogreader("URL")
blogimagelist.DataKeyField
blogimagelist.DataBind()
End If
This is the nested datalist:
--------------------------
<asp:datalist id="blogimagelist" RepeatColumns="4" RepeatDirection="Horizonta
Runat="server" Visible="False">
<ItemTemplate>
<table width="100" height="100" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="middle">
<a onclick="MyWindow=window.o
</td>
</tr>
</table>
</ItemTemplate>
<SeparatorTemplate>
<table width="5" cellpadding="0" cellspacing="0" border="0">
<tr>
<td align="center" valign="middle">
<font class="blog-list-headline"
<br>
<br>
</font>
</td>
</tr>
</table>
</SeparatorTemplate>
</asp:datalist>
attipa,
When I said I'm not seeing it.. I mean I'm not seeing what the error is exactly (through my own troubleshooting eyes). Therefore, I need your help in debugging it... try the stuff I mentioned in my last post and let's see where that gets us.
-- Jason
When I said I'm not seeing it.. I mean I'm not seeing what the error is exactly (through my own troubleshooting eyes). Therefore, I need your help in debugging it... try the stuff I mentioned in my last post and let's see where that gets us.
-- Jason
ASKER
here is the error:
DataBinder.Eval: 'System.Char' does not contain a property with the name ImageID.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: DataBinder.Eval: 'System.Char' does not contain a property with the name ImageID.
Source Error:
Line 80: <tr>
Line 81: <td align="center" valign="middle">
Line 82: <a onclick="MyWindow=window.o pen('../im age-detail .aspx?Imag eID=<%# DataBinder.Eval(Container. DataItem, "ImageID") %>','MyWindow','toolbar=no ,location= no,directo ries=no,st atus=no,me nubar=no,s crollbars= no,resizab le=yes,wid th=600,hei ght=700,le ft=10,top= 10'); return false;" href="#"><img src='../admin-createthumbn ail.aspx?f ilename=.. /BlogImage s/<%# DataBinder.Eval(Container. DataItem, "URL") %>&width=100' border="0"></a>
Line 83: </td>
Line 84: </tr>
DataBinder.Eval: 'System.Char' does not contain a property with the name ImageID.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: DataBinder.Eval: 'System.Char' does not contain a property with the name ImageID.
Source Error:
Line 80: <tr>
Line 81: <td align="center" valign="middle">
Line 82: <a onclick="MyWindow=window.o
Line 83: </td>
Line 84: </tr>
attipa,
Try swapping out line 82, with this:
<a onclick='<%# "MyWindow=window.open("".. /image-det ail.aspx?I mageID=" & DataBinder.Eval(Container. DataItem, "ImageID") & """,""MyWindow"",""toolbar =no,locati on=no,dire ctories=no ,status=no ,menubar=n o,scrollba rs=no,resi zable=yes, width=600, height=700 ,left=10,t op=10""); return false;" %>' href="#"><img src='../admin-createthumbn ail.aspx?f ilename=.. /BlogImage s/<%# DataBinder.Eval(Container. DataItem, "URL") %>&width=100' border="0"></a>
-- Jason
Try swapping out line 82, with this:
<a onclick='<%# "MyWindow=window.open(""..
-- Jason
ASKER
same error.
attipa,
And if you remove that whole line... does it work?
Just for fun... let's change that line to this:
<%# Container.DataItem.GetType .ToString( ) %>
That should tell us what type of object the Container.DataItem is... your error keeps telling us it's a System.Char... let's confirm.
-- Jason
And if you remove that whole line... does it work?
Just for fun... let's change that line to this:
<%# Container.DataItem.GetType
That should tell us what type of object the Container.DataItem is... your error keeps telling us it's a System.Char... let's confirm.
-- Jason
ASKER
it is System.Char
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
now we are in business....however, it skips the first record. It is suppose to produce 3 records...but only produces 2. And also, since there are 3 rows that are returned from the blogreader....it produces the parent datalist three times...how can we fix these last two problems?
attipa,
Can you show me a screenshot?
-- Jason
Can you show me a screenshot?
-- Jason
ASKER
Instead of just producing:
-------------------------- --
1 2 3
-------------------------- --
It is producing:
-------------------------- --
2 3
2 3
2 3
-------------------------- --
--------------------------
1 2 3
--------------------------
It is producing:
--------------------------
2 3
2 3
2 3
--------------------------
That's for the Inner DataList?
ASKER
both.
this is what I want happening
----------------------
1 2 3 is the inner datalist
it should only produce 1 time...the outer datalist
----------------------
this is what is happening
----------------------
2 3 inner datalist produces only 2 results instead of 3
2 3
2 3
outer datalist is producing three times
----------------------
this is what I want happening
----------------------
1 2 3 is the inner datalist
it should only produce 1 time...the outer datalist
----------------------
this is what is happening
----------------------
2 3 inner datalist produces only 2 results instead of 3
2 3
2 3
outer datalist is producing three times
----------------------
ASKER
i think what is happening is since there is 3 rows that the sqldatareader is producing
the first row is going to the outer datalist
the 2nd and 3rd rows are going to the inner datalist
how do I re-read and entire dataset produced by sqldatareader?
the first row is going to the outer datalist
the 2nd and 3rd rows are going to the inner datalist
how do I re-read and entire dataset produced by sqldatareader?
attipa,
I think you would have to go with something like a DataSet/DataTable in that situation....
-- Jason
I think you would have to go with something like a DataSet/DataTable in that situation....
-- Jason
What is the underlying datasource that is being bound to the bloglist DataList, is it a DataSet or DataReader?
Let's say it's a DataSet.. try this:
> blogID = DataBinder.Eval(e.Item.Dat
Replace that line with:
Dim row As DataRowView = CType(e.Item.DataItem, DataRowView)
blogID = CStr(row("BlogID"))
Let's see what that produces...
-- Jason