469,592 Members | 1,808 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,592 developers. It's quick & easy.

Problem with table creation & query

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
1 984
amitpatel66
2,367 Expert 2GB
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.

Similar topics

3 posts views Thread by Ricardo | last post: by
15 posts views Thread by Hemant Shah | last post: by
20 posts views Thread by Development - multi.art.studio | last post: by
10 posts views Thread by amitabh.mehra | last post: by
2 posts views Thread by swethak | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.