我想一个接一个地在html文件中显示两个datatables数据.

我想一个接一个地在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>";
    }
}