Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Selct fields


Message #1 by "Matthew Lohr" <mlohr@t...> on Mon, 10 Apr 2000 11:43:02 -0400
I have ordered the book asp databases but while I am waiting for it to

arrive I am trying to write some code to select fields from a database.  I

can do a select from one field in the database just fine.  I am trying to

have a second select field the pulls data based on what the first field is.

For example I want to have a select statement pull fields from a group

called department.  Then based on what department is selected I want to see

just those employees in that department in the employee field.  I don't want

to have to post two forms (one to select departments do a submit then one to

pull employees).  I know this can be done because I have seen it before.  It

must work something like it is loading all the employee data to the page in

the first place except you only see based on what your department selct

is(this is a guess).  Can anyone help?



Message #2 by "Blake" <blake@b...> on Mon, 10 Apr 2000 23:20:2
On 04/10/00, ""Matthew Lohr" wrote:

> I have ordered the book asp databases but while I am waiting for it to

> arrive I am trying to write some code to select fields from a database.  I

> can do a select from one field in the database just fine.  I am trying to

> have a second select field the pulls data based on what the first field is.

> For example I want to have a select statement pull fields from a group

> called department.  Then based on what department is selected I want to see

> just those employees in that department in the employee field.  I don't want

> to have to post two forms (one to select departments do a submit then one to

> pull employees).  I know this can be done because I have seen it before.  It

> must work something like it is loading all the employee data to the page in

> the first place except you only see based on what your department selct

> is(this is a guess).  Can anyone help?



Matthew-



Try storing all of this information in one table, simply use the string:



  SELECT * FROM MYTABLE WHERE DEPARTMENT = 'Department 1'



Hope this helps.

Message #3 by "Matthew Lohr" <mlohr@t...> on Thu, 13 Apr 2000 17:01:54 -0400
I have been playing with this but I still can't seem to work it right.  If

anyone wants to see an example of what I am talking about you can look at

http://216.50.69.82/samples/chap16/1616.htm this is using a comma seperated

values text sheet for it's data.  I want to do it in data base form and I

want the data not to list out but go in another select field.  If that is

not possible I want to at least be able to hyperlink and pass the value in a

hyperlink to another active server page to do a query.









-----Original Message-----

From: Blake 

Sent: Monday, April 10, 2000 11:00 PM

To: ASP Databases

Subject: [asp_databases] Re: Selct fields





On 04/10/00, ""Matthew Lohr" wrote:

> I have ordered the book asp databases but while I am waiting for it to

> arrive I am trying to write some code to select fields from a database.  I

> can do a select from one field in the database just fine.  I am trying to

> have a second select field the pulls data based on what the first field

is.

> For example I want to have a select statement pull fields from a group

> called department.  Then based on what department is selected I want to

see

> just those employees in that department in the employee field.  I don't

want

> to have to post two forms (one to select departments do a submit then one

to

> pull employees).  I know this can be done because I have seen it before.

It

> must work something like it is loading all the employee data to the page

in

> the first place except you only see based on what your department selct

> is(this is a guess).  Can anyone help?



Matthew-



Try storing all of this information in one table, simply use the string:



  SELECT * FROM MYTABLE WHERE DEPARTMENT = 'Department 1'



Hope this helps.

Message #4 by "Ken Schaefer" <ken.s@a...> on Mon, 17 Apr 2000 14:06:09 +1000
To do this you'll need to use javascript on the client side...(that's if you

want to avoid having to submit the form)



Cheers

Ken



> On 04/10/00, ""Matthew Lohr" wrote:

> > For example I want to have a select statement pull fields from a group

> > called department.  Then based on what department is selected I want to

> see

> > just those employees in that department in the employee field.  I don't

> want

> > to have to post two forms (one to select departments do a submit then

one

> to

> > pull employees).

> Matthew-






  Return to Index