retreiving data from a database with related tables

Posted on 2003-03-06
Medium Priority
Last Modified: 2010-04-15
hello all,

 im currently trying to build a simple bulletin board system (ASP.NET) which enables users to ask questions and add replies. so far i have built a database with 3 tables (topics, replies and posts) and bound the topics to 1 datagrid and the posts table to another for display on another page. the first page lists the topics(or questions asked)in a datagrid then a select button will link to another page showing 1 datagrid with the question and another underneath which i want to bind the replies too. my problem is that i need to relate the replies to the original question so only the replies in the replies table that are relevant to the question are shown in the datagrid underneath. sound confusing? - tell me about it. im sure most of you already know how a "proper" bulletin system works but it is too complicated for me so i have tried to break it down into easy to understand blocks.

Can anyone suggest how i can show the related replies only?

Question by:DasmunchenC
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3

Expert Comment

ID: 8080631
What are you using for a database?

Expert Comment

ID: 8083942
If I think I know what you mean. You have a buch of topics and whem you click on them you want the main topics and the replies. The easist thing to do is when you click on a topic you pass a TopicID to the next page. In the next page you look in the db. Wich replies have that TopicID. The query might be:
SELECT * FROM Replies WHERE TopicID='TopicID' the word between '' is the variable which you van call with the GET method. The URL of the link might be. http://bulletinboard.com/Replies.aspx?TopicID=33. I hope this helps. Good luck.

Author Comment

ID: 8084512
im using access from office xp
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Expert Comment

ID: 8086413
I agree with CoenMeerbeek.  You could use Access Visual Query editor to draw the relationships between tables (then you can view the SQL statements if you are not familiar with access SQL).  You will need 1 common field to cross reference all the tables (usually a primary key in the main table and a number in the rest).

Hope this helps.

Author Comment

ID: 8096940
how can i make a variable available to pass from page to page in c# and asp.NET?

Accepted Solution

FrostBite earned 400 total points
ID: 8099880
Read up on session variables.  A Simple example would be: Session["varname"] = text1.value;

Author Comment

ID: 8106474
thx for all the help guys, with frosrbites tip i figured out how to do it in the code as im not so hot with databases:)

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

765 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