Hi,
I have little problem with looping through datatable and then writing it to text file. The data is coming for datatable and I want it to look just like datatable in text file.
It looks like this so far.
hotel - Marriot
city - Idaho
address - 5555 yellowstone blvd
and I want it to look like this
hotel city address
Marriot Idaho 5555 yellowstone blvd
Marriot Utah 1234 Shipply Lane
Marriot Montana 4521 Blue Dr
Code:
foreach (DataRow datarow in dt_row.Rows)
{
foreach (DataColumn dataCD in dt_row.Columns)
{
w.WriteLine(datarow[dataCD].ToString());
}
}
Thanks
I have little problem with looping through datatable and then writing it to text file. The data is coming for datatable and I want it to look just like datatable in text file.
It looks like this so far.
hotel - Marriot
city - Idaho
address - 5555 yellowstone blvd
and I want it to look like this
hotel city address
Marriot Idaho 5555 yellowstone blvd
Marriot Utah 1234 Shipply Lane
Marriot Montana 4521 Blue Dr
Code:
foreach (DataRow datarow in dt_row.Rows)
{
foreach (DataColumn dataCD in dt_row.Columns)
{
w.WriteLine(datarow[dataCD].ToString());
}
}
Thanks