M
McGurk
Been looking for an answer to this all day. Tried a number of
different methods, but I can't find out how the heck to do this. If
you can help, I would greatly appreciate it.
Setup:
.NET C# application (web service)
SQL Server 2000 database
Tables in question:
Plan (user (pk), date (pk), recipe(pk, fk), time(pk))
Recipe (recipe (k), instructions)
Ingredients (recipe (pk, fk), foodID (pk, fk), amount, unit)
foodItem (foodID (k), name, etc etc)
Relations are obvious by name. pk's are partial keys, k's are
keys, fk's are foreign keys
Objective:
I want to create a DataSet to send to a user via a web
service. Obviously, I don't want to send anything more than I need.
I want to send the Plan table entries that match the user. No
problem. But I also want to send only the records in recipes that
match the key value of Plan, and only those ingredients that match the
key value of recipe, etc etc. In other words, only relevant related
data should be included. I don't want to pack up all recipes and
ingredients, etc. What I want, or maybe what I believe I want, is a
DataSet with four tables and relations and with only relevant data.
The idea is that the user would interact with these tables, and then
send back any modified rows, thus reducing overhead even more. On the
server side, its a simple matter to run an update on the dataset with
the right dataadapter.
As I've said, I've tried this several different ways, from creating
the dataset manually and then filing it with individual table data
adapters (Even with the constraints I get all table rows), using a
data adapter with a sql query that only returns the data I want (it
creates a new table for the data and ignores the structure I created),
etc etc. How should I do it? Am I going about this the wrong way?
Maybe I shouldn't do it this way at all... I don't know. I have two
books on ADO and I can't find what I'm looking for...
different methods, but I can't find out how the heck to do this. If
you can help, I would greatly appreciate it.
Setup:
.NET C# application (web service)
SQL Server 2000 database
Tables in question:
Plan (user (pk), date (pk), recipe(pk, fk), time(pk))
Recipe (recipe (k), instructions)
Ingredients (recipe (pk, fk), foodID (pk, fk), amount, unit)
foodItem (foodID (k), name, etc etc)
Relations are obvious by name. pk's are partial keys, k's are
keys, fk's are foreign keys
Objective:
I want to create a DataSet to send to a user via a web
service. Obviously, I don't want to send anything more than I need.
I want to send the Plan table entries that match the user. No
problem. But I also want to send only the records in recipes that
match the key value of Plan, and only those ingredients that match the
key value of recipe, etc etc. In other words, only relevant related
data should be included. I don't want to pack up all recipes and
ingredients, etc. What I want, or maybe what I believe I want, is a
DataSet with four tables and relations and with only relevant data.
The idea is that the user would interact with these tables, and then
send back any modified rows, thus reducing overhead even more. On the
server side, its a simple matter to run an update on the dataset with
the right dataadapter.
As I've said, I've tried this several different ways, from creating
the dataset manually and then filing it with individual table data
adapters (Even with the constraints I get all table rows), using a
data adapter with a sql query that only returns the data I want (it
creates a new table for the data and ignores the structure I created),
etc etc. How should I do it? Am I going about this the wrong way?
Maybe I shouldn't do it this way at all... I don't know. I have two
books on ADO and I can't find what I'm looking for...