【问题标题】:sql data to asp:table in C# [closed]sql数据到asp:C#中的表[关闭]
【发布时间】:2014-08-01 05:59:08
【问题描述】:

我希望该网页连接到 SQL 数据库,并在表格中显示选定的数据。我有一个问题:

select top 5 
    r.remoteid, 
    count(distinct m.mac) as mac,  
    count(distinct i.igmp) as igmp, 
    i.date
from 
    remoteid as r
join 
    dbo.mac as m on m.mazgas = r.mazgas and m.portas = r.portas 
join 
    dbo.igmp as i on i.mazgas = m.mazgas and i.portas = m.portas and i.date = m.date
where  
    i.date = DATEADD(day, datediff(day, 0, getdate()), -1)
group by 
    r.remoteid, r.mazgas, r.portas, m.vlan, m.date, i.date
order by 
    igmp desc

用 HTML (<asp:Table ID="Table1" runat="server"></asp:Table>) 将返回值填充到 asp:table 的最佳方法是什么。

表格应如下所示:

remoteid     date  
 remote    mac|igmp

谢谢。

【问题讨论】:

标签: c# asp.net sql datatable


【解决方案1】:

<asp:Table> 不是数据控件。你必须使用<asp:GridView>。

【讨论】:

  • 我不知道''。现在我已经通过制作数据表和绑定数据来制定解决方案。
猜你喜欢
  • 1970-01-01
  • 2013-02-21
  • 2023-03-23
  • 1970-01-01
  • 2013-07-12
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多