Code:
@using WebMatrix.WebData @* Remove this section if you are using bundling *@ @section Scripts { <script src="~/Scripts/jquery.validate.min.js"></script> <script src="~/Scripts/jquery.validate.unobtrusive.min.js"></script> } <style> table, th, td { border: solid 1px #bbbbbb; border-collapse: collapse; padding: 2px; } </style> @{ WebSecurity.RequireAuthenticatedUser(); Layout = "~/_SiteLayout.cshtml"; Page.Title = "Manage Account"; } @{ var Char = UrlData[0]; var db= Database.Open("PS_GameData"); var sqlQ = "SELECT ci.CharID,i.ItemName,ci.Bag,ci.Slot,ci.ItemUID,ci.Count,ci.Del From PS_GameData.dbo.CharItems ci inner join PS_GameDefs.dbo.Items i on ci.Type=i.Type and ci.TypeID = i.TypeID WHERE CharID=@0 and Del='0'"; var data = db.Query(sqlQ, Char); } <table> <thead> <tr> <th>Item Name</th> <th>Bag Number</th> <th>Slot</th> <th>Count</th> </tr> </thead> <tbody> @foreach(var row in data){ <tr> <td>@row.ItemName</td> <td>@row.Bag</td> <td>@row.Slot</td> <td>@row.Count</td> </tr> } </tbody> </table>