| Author: Praveen 04 Nov 2009 | Member Level: Diamond | Rating:  Points: 2 |
hi,
read the excel data in to a datatable
let say DataTable dtOriginal is the Original Table
let say dtCopy is the Copy of the Original Table
private void SampleCode(DataTable dtOriginal) { DataTable dtCopy=new DataTable() foreach(DataColumn dc in dtOriginal.Columns) dtCopy.Columns.Add(dc.ColumnName,dc.ColumnType); DataRow[] drSelect=null; RepeatProcess: if(dtOriginal.Row.Count>0) { drSelect=dtOrignal.Select("Date="+dtOrignal.Rows[0]["Date"]+"); foreach(DataRow dr in drSelect) { dtCopy.ImportRow(dr); dtOriginal.Rows.Remove(dr); // write code to create text File } goto RepeatProcess; } }
hope that will give you an idea
|