473,326 Members | 2,175 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

repeater and SQL question

Hy!

I'm making a little commenting module for news section of my little
homepage. And I don't know how to embed viewing news comments into it.

I have repeater like this:
<asp:Repeater ID="news" Runat="server">
<ItemTemplate>
<table width="100%">
<tr bgcolor="#c6c8b9">
<td class="newsTitle"><%# DataBinder.Eval(Container.DataItem, "Title")%>
</td>
<td width="100" align="right"><%# DataBinder.Eval(Container.DataItem,
"Date")%> </td>
</tr>
<tr bgcolor="#d5d3ca">
<td colspan="2" class="text"><%# DataBinder.Eval(Container.DataItem,
"Body")%><br><br>
<!-- comments goes right here (somewhere) -->
</td>

</tr>
</table>
<br>
</ItemTemplate>
</asp:Repeater>

I then bind datasource to SqlDataSource (.NET 2.0) -- like this -->
news.DataSourceID = NewsDS.ID; (pretty much no interaction going on here).

I have tables news (columns id, title, body, date) and news_comments
(columns id, body, news_id). news_id is a id of a news to which comment
belongs.

What I don't know is, how to select the correct comments and add them into
the repeater (I've commented the place where I want comments to be).

Can anyone help me with any solution?
-- Samo Kralj
Nov 18 '05 #1
3 1275
One more thing... I want all this to be done once (at the page load),
becouse I have then client side code to expand/collapse those comments (it
isnt seen from code I provided, but I think it is not relavant here).
"SamoK" <sn***@wetsoftware.com> wrote in message
news:5r******************@news.siol.net...
Hy!

I'm making a little commenting module for news section of my little
homepage. And I don't know how to embed viewing news comments into it.

I have repeater like this:
<asp:Repeater ID="news" Runat="server">
<ItemTemplate>
<table width="100%">
<tr bgcolor="#c6c8b9">
<td class="newsTitle"><%# DataBinder.Eval(Container.DataItem, "Title")%> </td>
<td width="100" align="right"><%# DataBinder.Eval(Container.DataItem,
"Date")%> </td>
</tr>
<tr bgcolor="#d5d3ca">
<td colspan="2" class="text"><%# DataBinder.Eval(Container.DataItem,
"Body")%><br><br>
<!-- comments goes right here (somewhere) -->
</td>

</tr>
</table>
<br>
</ItemTemplate>
</asp:Repeater>

I then bind datasource to SqlDataSource (.NET 2.0) -- like this -->
news.DataSourceID = NewsDS.ID; (pretty much no interaction going on here).

I have tables news (columns id, title, body, date) and news_comments
(columns id, body, news_id). news_id is a id of a news to which comment
belongs.

What I don't know is, how to select the correct comments and add them into
the repeater (I've commented the place where I want comments to be).

Can anyone help me with any solution?
-- Samo Kralj

Nov 18 '05 #2
On Sun, 4 Jul 2004 10:51:48 +0200, SamoK <sn***@wetsoftware.com> wrote:
One more thing... I want all this to be done once (at the page load),
becouse I have then client side code to expand/collapse those comments
(it
isnt seen from code I provided, but I think it is not relavant here).
"SamoK" <sn***@wetsoftware.com> wrote in message
news:5r******************@news.siol.net...
Hy!

I'm making a little commenting module for news section of my little
homepage. And I don't know how to embed viewing news comments into it.

I have repeater like this:
<asp:Repeater ID="news" Runat="server">
<ItemTemplate>
<table width="100%">
<tr bgcolor="#c6c8b9">
<td class="newsTitle"><%# DataBinder.Eval(Container.DataItem,

"Title")%>
</td>
<td width="100" align="right"><%#
DataBinder.Eval(Container.DataItem,
"Date")%> </td>
</tr>
<tr bgcolor="#d5d3ca">
<td colspan="2" class="text"><%# DataBinder.Eval(Container.DataItem,
"Body")%><br><br>
<!-- comments goes right here (somewhere) -->
</td>

</tr>
</table>
<br>
</ItemTemplate>
</asp:Repeater>

I then bind datasource to SqlDataSource (.NET 2.0) -- like this -->
news.DataSourceID = NewsDS.ID; (pretty much no interaction going on
here).

I have tables news (columns id, title, body, date) and news_comments
(columns id, body, news_id). news_id is a id of a news to which comment
belongs.

What I don't know is, how to select the correct comments and add them
into
the repeater (I've commented the place where I want comments to be).

Can anyone help me with any solution?
-- Samo Kralj



It sounds like you're doing things very similar to this example from MSDN
magazine:

http://msdn.microsoft.com/msdnmag/is...g/default.aspx

I use this blog app myself (well, I did port it to C# w/ some mods) and it
does what you're doing. Your answer and examples are in there.

--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET
Nov 18 '05 #3
Thanks Craig... I found that link very useful... and it works now :)
Thanks again!

-- Samo

"Craig Deelsnyder" <cdeelsny@no_spam_4_meyahoo.com> wrote in message
news:opsamlhzvo75dg5d@g51y101...
On Sun, 4 Jul 2004 10:51:48 +0200, SamoK <sn***@wetsoftware.com> wrote:
One more thing... I want all this to be done once (at the page load),
becouse I have then client side code to expand/collapse those comments
(it
isnt seen from code I provided, but I think it is not relavant here).
"SamoK" <sn***@wetsoftware.com> wrote in message
news:5r******************@news.siol.net...
Hy!

I'm making a little commenting module for news section of my little
homepage. And I don't know how to embed viewing news comments into it.

I have repeater like this:
<asp:Repeater ID="news" Runat="server">
<ItemTemplate>
<table width="100%">
<tr bgcolor="#c6c8b9">
<td class="newsTitle"><%# DataBinder.Eval(Container.DataItem,

"Title")%>
</td>
<td width="100" align="right"><%#
DataBinder.Eval(Container.DataItem,
"Date")%> </td>
</tr>
<tr bgcolor="#d5d3ca">
<td colspan="2" class="text"><%# DataBinder.Eval(Container.DataItem, "Body")%><br><br>
<!-- comments goes right here (somewhere) -->
</td>

</tr>
</table>
<br>
</ItemTemplate>
</asp:Repeater>

I then bind datasource to SqlDataSource (.NET 2.0) -- like this -->
news.DataSourceID = NewsDS.ID; (pretty much no interaction going on
here).

I have tables news (columns id, title, body, date) and news_comments
(columns id, body, news_id). news_id is a id of a news to which comment
belongs.

What I don't know is, how to select the correct comments and add them
into
the repeater (I've commented the place where I want comments to be).

Can anyone help me with any solution?
-- Samo Kralj



It sounds like you're doing things very similar to this example from MSDN
magazine:

http://msdn.microsoft.com/msdnmag/is...g/default.aspx

I use this blog app myself (well, I did port it to C# w/ some mods) and it
does what you're doing. Your answer and examples are in there.

--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET

Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Fraggle | last post by:
I have a repeater with controls added at run time. the <template> also contains a <asp:textbox that is made visible on some repeater elements. when I come to read the text info out it has...
1
by: olduncleamos | last post by:
Hello all, I am experimenting with the repeater control and ran into something that I wasn't expecting. I would appreciate if the experts can confirm or correct my understanding. Here is a...
3
by: Andrew | last post by:
Hi, I am working on a questionnaire. I have displayed a questionnaire using a repeater control. The itemtemplate is as below (quite cut down): <ItemTemplate> <tr><td> <%#...
3
by: Brian | last post by:
Using external XML, I'm trying to build a quiz, but I can't seem to specify the DataSource for the RadioButtonList within a Repeater ItemTemplate. I've tried a number of approaches, but I haven't...
12
by: =?Utf-8?B?Qi4gQ2hlcm5pY2s=?= | last post by:
I'm doing a web app in VB/Dot Net 2.0. I'm probably a bit rusty and I have no experience using the repeater control. I have a user control I've created with multiple properties. I've created a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.