retreiving data from a database with related tables
Posted on 2003-03-06
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?