By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,377 Members | 1,326 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,377 IT Pros & Developers. It's quick & easy.

Problem with table creation & query

P: 44
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 DropDownListboxes. 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 DropDownListboxes should show ‘CHOOSE’(‘Choose 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
Mar 20 '08 #1
Share this Question
Share on Google+
1 Reply


amitpatel66
Expert 100+
P: 2,367
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 DropDownListboxes. 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 DropDownListboxes should show ‘CHOOSE’(‘Choose 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:

Expand|Select|Wrap|Line Numbers
  1.  
  2. SELECT mname FROM movie WHERE tid = (SELECT tid FROM theater WHERE tname = <p_tname>);
  3.  
  4.  
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.
Mar 20 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.