Coding Parctices DataGrids

K

keys4worship

Here goes...
I am very new to programming. I am currenting using Visual Studio C# to
connect to SQL db. The db has only one table and two views. I have
created 3 datagrids on one page along with 3 sqladapters and datasets.
Each adapter uses a stored procedure used with the table and two views.
I have used the views to present summary totals of regions and areas
respectively. The first datagrid displays regional summary data. This
data consists of rows showing the area offices within the region and
total items pending in each area. Clicking on the area name in a row
will trigger the second datagrid which displays information for the
area along with summary data for the offices within the area. Clicking
on the office name in this grid triggers the third datagrid with
detailed information of items within that office. I am sure doing a lot
of setting of the visible properties of these datagrids. Is there a
better/proven way to deal with something like this?

Thanks
 
G

Guest

dear keys4worship,

From the matter that you have written below, it is clear that the data in
the tables and vies are related (preferable using key value). consider this
case as a Parent/Child relationship between the table and view respectively.

You can thus bring all the data related to the three tables into a single
dataset at the begining of the request using a single data adapter. Then you
can associate these data tables (tables and views) using a DataRelation
object and then use the DataRow.GetParentRow method of the parent table to
get the required values from the child tables.

Hope this helps ....

regards,

Kishor.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,999
Messages
2,570,244
Members
46,839
Latest member
MartinaBur

Latest Threads

Top