這裏是我的代碼Vb.net:是否有可能返回SQL SELECT語句的結果HTML表
Protected Sub Submit_Click(sender As Object, e As EventArgs)
Dim sSQL As String
sSQL = "Select (ID),fromcur as 'From Currency',tocur as 'To Currency',rate as 'Conversion Rate',cast(convtimestamp as datetime) as 'Updated Time'
from Locations.dbo.Uni_Currency_Exchange_Rates
where fromCur = '" + FromCur.Text + "' and toCur = '" + ToCur.Text + "' order by ConvTimeStamp desc "
Location2.SelectCommand = sSQL.ToString
Dim command3 As New SqlCommand(sSQL, connection)
????????????????
End Sub
我需要生成HTML表的代碼 這對於每個記錄
像
創建行<table>
<th>ID</th>
<th>From Currency</th>
<th>To Currency</th>
<th>Rate</th>
<th>Update Time</th>
<tr>1</tr>..............................
<tr>2</tr>..............................
.............................
</Table>
顯示這樣的結果。
ID |從貨幣|貨幣|價格|更新時間
1 | MVR | USD | 15.42 | 3/25/14 12:00:00
1 | MVR | EUR | 22.00 | 3/25/14 12:00:00
有沒有簡短的方法來實現這一目標?
在此先感謝
您使用的是ASP.NET嗎? 你可以創建一個'Table'對象並用循環填充你的行和單元格。 – Tim
Ya其Asp.net 4.5(aspx頁面) –
在這種情況下,您使用MVC的是哪種類型的頁面?形式? – RoughPlace