User-1422633144 posted
Hi - Sorry for the rambling title.
Here is what i am trying to do:
On the homepage is a webgrid list of trolleys - this is from a Table in the DB with Trolley Name and Trolley ID - only the trolley name is visable.
I have made this webgrid so that you can click on an individual trolley and it takes you to a second page and displays the trolley name as the header of the page
@{
Page.Title = "Parts";
var db = Database.Open("ETS");
var query = "SELECT Trolleydesc FROM Trolleys WHERE trolleydesc = @0";
var data = db.QuerySingle(query, UrlData[0]);
}
@foreach(var item in data.GetDynamicMemberNames()){
<H1>@data[item]</h1>
Now what i would like to do is to have another web-grid appear below this header and for that to show all of the individual parts of the trolley selected. this is held in a separate table. I have the SQL below but i dont know how to change
the Where Trolleyid = (The TrolleyID value of the trolley the user selected in the first Webgrid) Is this possible?
@{
var selectQueryString = "SELECT * from parts join parts_trolley on parts_trolley.partdesc = parts.partdesc where parts_trolley.trolleyid = @0 order by parts.type";
var tdata = db.Query(selectQueryString);
var grid = new WebGrid(tdata, rowsPerPage:50);
}
Thank you for any help you can give.