none
Linq to SQL display data from two tables to a single hierarchical unordered list RRS feed

  • Question

  • Hello all I wrote a question in the asp.net mvc forum here and am wondering if anyone with linq to sql experience can help me.

    As said in the subject line,  I have two tables, one with categories and other with items  and want to display them as a  hierarchical unordered list as seen in my post here:

    http://forums.asp.net/t/1489511.aspx

    Currently I'm working in asp.net mvc, which has the code spread in the controller .cs file as well as some of the list code in the view .aspx page. 

    there is a linq to sql in the database model file, and the code on the controller is using DataContext .

    I wouldn't mind getting advice on doing this as simply as possible with a linq to sql query that could give me the desired result, with variable that I could eventually pass the the html page if necessary, but I don't know If I should:

    1. continue pulling trying to code in what I have which has lead me to a dead end with a static variable/parameter
    2. try a nested for loop in a for loop of the query
    3. possibly try a a left join which I believe is a group join in LINQ then rework my Ilst
    4. how to get a dynamic variable of the category code to pas to the query for the item query
    5. other

    Any thoughts or advice  on which direction to take will be much appreciated.
    Friday, November 6, 2009 5:17 PM

Answers

All replies