这里是我的代码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