Retrieving data in parts
-
Hi all, I'm trying to allow the user to store an article in a table where the article body can take ANY number of parts each displayed as a separate page on a webpage. I thought I would store the entire article in the Article table but separated by a delimiter like, the only problem is, after I store the record, how would I go ahead a retrieve the data IN PARTS so that it can be displayed in a repeater?
-
Hi all, I'm trying to allow the user to store an article in a table where the article body can take ANY number of parts each displayed as a separate page on a webpage. I thought I would store the entire article in the Article table but separated by a delimiter like, the only problem is, after I store the record, how would I go ahead a retrieve the data IN PARTS so that it can be displayed in a repeater?
Hi, I would not do that. I suggest you store the smallest part you're interested in as one item, then build larger stuff from multiple items. This is similar to storing first name and last name separately, it gives easy access to both of them, and when you need both together, you can easily combine them. So create two tables: table "article" holds overall information on an article (ID, title, author, date, ...); table "page" holds the content of one page, the page number, and the article ID. :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
Prolific encyclopedia fixture proof-reader browser patron addict?
We all depend on the beast below.
-
Hi all, I'm trying to allow the user to store an article in a table where the article body can take ANY number of parts each displayed as a separate page on a webpage. I thought I would store the entire article in the Article table but separated by a delimiter like, the only problem is, after I store the record, how would I go ahead a retrieve the data IN PARTS so that it can be displayed in a repeater?
I wouldn't store the entire article commna delimited. What if there's a comma in the article? I'd store the parts in some kind of Parts table, then have another table that tells which parts go with which article.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009... -
Hi, I would not do that. I suggest you store the smallest part you're interested in as one item, then build larger stuff from multiple items. This is similar to storing first name and last name separately, it gives easy access to both of them, and when you need both together, you can easily combine them. So create two tables: table "article" holds overall information on an article (ID, title, author, date, ...); table "page" holds the content of one page, the page number, and the article ID. :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
Prolific encyclopedia fixture proof-reader browser patron addict?
We all depend on the beast below.
Hi Luc, Thanks for the reply. Let me just make things clear. 1 - I will store the small details in the Article table. 2 - I will store the parts of the articles as separate records in a "Parts" table. 3 - Each part will have an article ID. 4 - I will call details FROM article table AND parts table WHERE ID is the one clicked on by the user One last problem: Due to the user being able to store ANY number of parts PER article, how do I connect each part to a repeater? I would like the repeater to do "Paging" on each part. Is that possible?
-
I wouldn't store the entire article commna delimited. What if there's a comma in the article? I'd store the parts in some kind of Parts table, then have another table that tells which parts go with which article.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009... -
Hi Luc, Thanks for the reply. Let me just make things clear. 1 - I will store the small details in the Article table. 2 - I will store the parts of the articles as separate records in a "Parts" table. 3 - Each part will have an article ID. 4 - I will call details FROM article table AND parts table WHERE ID is the one clicked on by the user One last problem: Due to the user being able to store ANY number of parts PER article, how do I connect each part to a repeater? I would like the repeater to do "Paging" on each part. Is that possible?
Dayekh wrote:
3 - Each part will have an article ID.
Yes, store each part/page of an article with its part/page number and with the one article ID so it points into the right row of your articles table. I don't know about the Repeater Control, I've never used any, I haven't done any ASP.NET However I trust it can be done, in fact I expect it to be pretty simple. :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
Prolific encyclopedia fixture proof-reader browser patron addict?
We all depend on the beast below.
-
Dayekh wrote:
3 - Each part will have an article ID.
Yes, store each part/page of an article with its part/page number and with the one article ID so it points into the right row of your articles table. I don't know about the Repeater Control, I've never used any, I haven't done any ASP.NET However I trust it can be done, in fact I expect it to be pretty simple. :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
Prolific encyclopedia fixture proof-reader browser patron addict?
We all depend on the beast below.