Solved

table vs subtable -- ASP.Net MVC 4 C# ?

Posted on 2013-06-25
1
563 Views
Last Modified: 2013-06-26
I need to allow users to create new COMMENTS,
but keep the old comments viewable in READ-ONLY mode.

Which option would you do and do you have any easy examples ?
 ** Option #1 - stored in MAIN table's Comments field
 ** Option #2 - stored in SUB table's Comments field,
                doing a LOOP to get all existing comments,
                then textbox so users can enter more
---------------------------------------------------
Steps
 1. click EDIT
 2. existing TableName.Comments text displays as below LABEL
       John Doe  6/1/13: This is test #1
       Jane Doe  6/3/13: This is test #2, line #1
                         This is test #2, line #2
 3. Bob Smith enters "This is test #3" into TableName.Comments TEXTBOX
 4. clicks SAVE
 5. below displays
       John Doe  6/1/13: This is test #1
       Jane Doe  6/3/13: This is test #2, line #1
                         This is test #2, line #2
       Bob Smith 6/7/13: This is test #3
0
Comment
Question by:finance_teacher
1 Comment
 
LVL 11

Accepted Solution

by:
lenordiste earned 500 total points
ID: 39275591
I would personally add a dedicated table for Comments with fields: commentId, author, dateStamp, comment, parentTopicId. Where parentTopicId is a reference to what may be your "MAIN" table. This way you don't have to mess up working with a big field of text and can easily identify the latest comment (sort by date!).
0

Featured Post

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
defining NULL or 0 10 44
Help with opening combobox using VB.NET. 3 26
looking for an ASP.net report designer 4 12
Data organization issue 7 18
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question