DotNet Alliance
Showing posts with label
Datatable
.
Show all posts
Showing posts with label
Datatable
.
Show all posts
Saturday, 16 February 2013
How to change dataview to datatable in C#?
There are situations, we have to convert a dataview to datatable as the code below.
Dataable dt=dv.ToTable();
Enjoy!!
How to Export Data Table to Excel quickly?
How to export data table to excel fast?
If we want to export datatable to excel worksheet cells quickly then use the following method
int col = 1, row = 1;
foreach (DataRow dr in Table.Rows)
{
foreach (object value in dr.ItemArray)
{
worksheet.Cell(row, col++).Value = value;
worksheet.Cell(row, col++).Value = dc.Caption;
}
row++;
col = fromCol;
}
Home
Subscribe to:
Posts (Atom)
You might also like: