我想一个接一个地在html文件中显示两个datatables数据. [英] i want to show two datatables data in html file one after another.

查看:82
本文介绍了我想一个接一个地在html文件中显示两个datatables数据.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设数据集中有两个表.

Suppose I have two tables in dataset.

DataSet ds = new DataSet();

ds.tables[0]; and 
ds.tables[1];

like this

I want to convert above dataset records to html file and show that html file but first time show first dataset records after complete first dataset showing second dataset records on same html file.
i able to convert only ds.tables[0] but how to convert ds.tables[1] also.
how can it possible?

推荐答案



请参阅以下链接.........

http://www.c-sharpcorner .com/uploadfile/farooque84/data-binding-from-dataset-to-html-table-in-net/ [ http://stackoverflow.com/questions/808905/dataset-in-html [ ^ ]
Hi,

refer Following Links............

http://www.c-sharpcorner.com/uploadfile/farooque84/data-binding-from-dataset-to-html-table-in-net/[^]

http://stackoverflow.com/questions/808905/dataset-in-html[^]


您好,

这对您有帮助.请尝试一次.
Hello,

This is helpful to you. Pls try once.
string strTable;

foreach (DataTable vTable in dsDataSet.Tables)
{
    foreach (DataRow vRow in vTable.Rows)
    {
        strTable = "<table style='clear:both'><tr>";

        foreach (DataColumn vCol in vTable.Columns)
        {
            strTable+= "<td>" + vRow[vCol.ColumnName] + "</td>";
        }
        strTable += "</tr></table>";
    }
}


这篇关于我想一个接一个地在html文件中显示两个datatables数据.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆