Using Typed Datasets in asp.net 2.0

  • Thread starter Thread starter amit
  • Start date Start date
A

amit

I am having a play with typed datasets in ASP.Net 2.0



I am using the builder to create my data layer.



I have the following tables.



[EmployeeType], [Departments], [Location], and [Groups]



The first three tables above have a one to many relation ship to
[Groups] via mapping tables [EmpType2Group], [Dept2Group] and
[Loc2Group] so each record of the first three tables can be linked to
many groups and each of the first three tables can also be linked to
the same group.



I have stored procedures that will return the groupsByLocation,
groupsByDepartments etc.



Now I have created datasets for each of the tables (empType, dept, loc
and groups) with their appropriate table adapters and get methods.



My question is, where do I add the methods GetGroupByLocation, etc? I
cant add them to the Location dataset as the schema doesn't have a
group field, and I cant add them to the Group dataset (which is were I
would imagine it to go) because there is no locationID field in the
schema.



Any ideas?



Cheers

Amit
 
I would just create a new dataset for the results from your stored
proc, rather than try to insert them into the dataset which has already
been populated. Or am I misunderstanding you?
 
I think what you might need to do is create a view (or several views) which
includes all the fields you need. So one of your views would have groups
with locationID for example. From this view you can make another dataset,
table adapter, etc.

Will
 
Back
Top