• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 204
  • Last Modified:

retreiving data from a database with related tables

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?

regards,
dasC
0
DasmunchenC
Asked:
DasmunchenC
  • 3
  • 3
1 Solution
 
FrostBiteCommented:
What are you using for a database?
0
 
CoenMeerbeekCommented:
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.
0
 
DasmunchenCAuthor Commented:
im using access from office xp
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
FrostBiteCommented:
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.
0
 
DasmunchenCAuthor Commented:
how can i make a variable available to pass from page to page in c# and asp.NET?
0
 
FrostBiteCommented:
Read up on session variables.  A Simple example would be: Session["varname"] = text1.value;
0
 
DasmunchenCAuthor Commented:
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:)
regards
das
0

Featured Post

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!

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now