Solved

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

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

757 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

22 Experts available now in Live!

Get 1:1 Help Now