简单教程
提交运行
代码编辑器:
@{ var db = Database.Open("SmallBakery"); var selectQueryString = "SELECT * FROM Product ORDER BY Name"; } <!DOCTYPE html> <meta charset="utf-8" /> <h1>Small Bakery Products</h1> <table> <tr> <th>Id</th> <th>Product</th> <th>Description</th> <th>Price</th> </tr>@foreach(var row in db.Query(selectQueryString)) { <tr> <td>@row.Id</td> <td>@row.Name</td> <td>@row.Description</td> <td align="right">@row.Price</td> </tr> } </table>
运行结果: