Solved

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

Posted on 2013-06-25
1
556 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

895 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now