How to change data displayed in one GridView depending on selection made in the second one? (ASP.NET 2.0)



Hi all.

I have two tables in my database: TableA and TableB. Records in TableB
contain foreing key to records from TableA (it is a relation one to
many: one row from TableA could have many rows from TableB connected to
it).

In DataSet Designer I created two DataTables: TableA and TableB. They
are also connected with relation MyRelation.

In my web page I want to have two GridViews:
- GridViewA - in this one records from TableA should be displayed.
- GridViewB - in this one records from TableB should be displayed (but
only these ones, which have TableA_id foreign key equal to primary key
from row selected in GridViewA).

Futhermore I want to do sth like this:
1. I select some row in GridViewA.
2. Data in GridViewB should by dynamically changed without executing
additional query against my database.

Does anybody know how it can be done?

Thanks in advance.

.



Relevant Pages

  • Re: Query with mathematics criteria!!?? Help!
    ... I might not even add the new record to the database if it doesn't ... > Create a Cartesian join query by adding TableA and TableB to the query ...
    (microsoft.public.access.queries)
  • Re: Copy complete tables - What is the best pattern?
    ... location, re-attach it using sp_attach_db, and then use sp_renamedb to swap ... in the new database... ... TableA and TableB are in the same physical> database. ...
    (microsoft.public.sqlserver.programming)
  • Re: Subscribing to a Transactional Publication
    ... I have a database table [TableA] that continuously has information ... I need to create another database containing [TableB] on another server ...
    (microsoft.public.vb.general.discussion)
  • Basic Question about DELETE
    ... Just a basic question regarding a relational database like MySQL. ... I am using a MySQL database wherein tables are, naturally, linked to other ... Say I have tableA and tableB. ...
    (comp.lang.java.databases)
  • Re: Cursors (again)
    ... What does it matter if TableB is temporary? ... or tableA. ... open cTableB ...
    (microsoft.public.sqlserver.programming)