Problem with table creation & query

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sweatha
    New Member
    • Mar 2008
    • 44

    Problem with table creation & query

    Dear Friends

    This is Sweatha. Right now I am working in the ASP.NET 2005 with VB coding & the back end is SQL SERVER 2000.

    My dilemma is

    I have to design a form with 2 DropDownListbox es. I have to load the ‘names of the theater’ on the 1st DropDownListbox & the names of the movie on the second DropDownListbox . That’s why I have created 2 tables named ‘theater’ and ‘movie’ on sql server 2000. The ‘theater’ table consists of 2 fields
    1) tid
    2) tname

    The movie table has 2 fields

    1) mid
    2) tid
    3) mname

    If I select a item in theater DropDownListbox , then the corresponding movies should be filled on the movie DropDownListbox . And by default, both the DropDownListbox es should show ‘CHOOSE’(‘Choos e Theater’ in Theater-DropDownListbox and ‘Choose Movie’ in Movie DropDownListbox )

    Now the problem is, I don’t know what is the next step to do is.

    There is also some more thing to do. If I select the ‘theater’ & ‘movie’ & if I click the ‘Go’ button, then it should link to the next page which shows the corresponding “Show Time” of that particular selected movie & theater.

    As I am new, I need the step, the exact query & ....

    -sweatha
  • amitpatel66
    Recognized Expert Top Contributor
    • Mar 2007
    • 2358

    #2
    Originally posted by sweatha
    Dear Friends

    This is Sweatha. Right now I am working in the ASP.NET 2005 with VB coding & the back end is SQL SERVER 2000.

    My dilemma is

    I have to design a form with 2 DropDownListbox es. I have to load the ‘names of the theater’ on the 1st DropDownListbox & the names of the movie on the second DropDownListbox . That’s why I have created 2 tables named ‘theater’ and ‘movie’ on sql server 2000. The ‘theater’ table consists of 2 fields
    1) tid
    2) tname

    The movie table has 2 fields

    1) mid
    2) tid
    3) mname

    If I select a item in theater DropDownListbox , then the corresponding movies should be filled on the movie DropDownListbox . And by default, both the DropDownListbox es should show ‘CHOOSE’(‘Choos e Theater’ in Theater-DropDownListbox and ‘Choose Movie’ in Movie DropDownListbox )

    Now the problem is, I don’t know what is the next step to do is.

    There is also some more thing to do. If I select the ‘theater’ & ‘movie’ & if I click the ‘Go’ button, then it should link to the next page which shows the corresponding “Show Time” of that particular selected movie & theater.

    As I am new, I need the step, the exact query & ....

    -sweatha
    Try this query toi get the movie names for a particular theatre when a theatre is selected:

    [code=sql]

    SELECT mname FROM movie WHERE tid = (SELECT tid FROM theater WHERE tname = <p_tname>);

    [/code]

    p_tname will be a variable in your ASP.NET which will hold the value of the theater when selected by the user and using that value we will fetch the movie names of that theater and pass it on to second drop down list.

    Comment

    Working...