"Vertical Slice" of a DataSet

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a DataSet with three tables: (sorry, I'm at another PC and don't have access to my code to provide an XML snippet

myDataSet.Tables[0].TableName = "AccountManagers"
myDataSet.Tables[1].TableName = "NewsFeeds"
myDataSet.Tables[2].TableName = "NewsFeedArticles"

There are two DataRelations in this DataSet, they are defined as follows

myDataSet.DataRelations.Add
"AccountManagers_NewsFeeds",
myDataSet.Tables["AccountManagers"].Columns["UserId"]
myDataSet.Tables["NewsFeeds"].Columns["UserId"])

an

myDataSet.DataRelations.Add
"NewsFeeds_NewsFeedArticles",
myDataSet.Tables["NewsFeeds"].Columns["SubscriptionId"]
myDataSet.Tables["NewsFeedArticles"].Columns["SubscriptionId"])

The NewsFeedArticles table is filled with "articles" from an RSS feed.

Here's what I need to do: (pseudo code

for every entry in myDataSet.Tables["AccountManagers"].Row

Generate some simple HTML as follows

AccountManage
NewsFee
NewsFeedArticl
NewsFeedArticl
NewsFeedArticle ..
NewsFee
NewsFeedArticl
NewsFeedArticl
NewsFeedArticle ..

It's easy to do the XSL transformation on a whole DataSet. My difficulty is coming from the fact that I have to do a tranformation on a vertical slice of the DataSet.

So what I have to do is basically create a copy of the DataSet for each entry in .Tables["AccountManagers"]. I would fill the other tables using the two DataRelations.
That seems inefficient. Is there an easier way to select a "vertical slice" of this DataSet?

Hope I made sense, thank you.
 
That gives me an array of DataRows though, not a new DataSet (which is what I need, since I'm creating an XmlDataDocument from it)
 
Sure it gives you an array of DataRows..... so either loop through the
array.... or load them back into a DataTable and push it into a
DataSet.....

George Durzi said:
That gives me an array of DataRows though, not a new DataSet (which is
what I need, since I'm creating an XmlDataDocument from it)
 
Back
Top