Click here to Skip to main content
15,888,908 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Suppose I have two tables in dataset.
C#
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?
Posted
Updated 14-Feb-12 21:01pm
v9
Comments
Varun Sareen 14-Feb-12 6:54am    
Question is not clear. What do you want to achieve and where you are facing problem?
Sergey Alexandrovich Kryukov 14-Feb-12 10:44am    
What have you done so far? Can you show just one :-)
--SA
manognya kota 15-Feb-12 1:46am    
could you please share what you have done so far?
Tejas Vaishnav 15-Feb-12 1:50am    
means what you want, you want to create saprate two files fro two table or attach the second table data to the existing html file...
dA.d 15-Feb-12 3:05am    
i hv two tables in dataset in that of table i am converted to html file and i m getting the output in html file also but i want to both tables record display in same html file

Hello,

This is helpful to you. Pls try once.
C#
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>";
    }
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900