Hi,
I have created a c# program to generate excel.That working fine.But i am facing a challenge now.I need to add around 100 of data in to the excel row using c#(add to table.Rows.Add()) .For small data i can manualy add.but my client given data like in txt file.I have created coloum data but how can i programaticaly add rows from .txt file?
I need to add below data to table.Rows.Add(1, 2, "M", "M", "M", "M", "M", "M", "M"); this format
567611
15
appu
Oracle Learning Management
HPHC Learner Self Service
N/A
General Role
OPEN
APPROVED: da
567611
15
appu
Oracle Learning Management
HPHC Learner Self Service
N/A
General VDI Role
OPEN
APPROVED: ss
i have 100 data like this in txt format.please help me
What I have tried:
public System.Data.DataTable ExportToExcel()
{
System.Data.DataTable table = new System.Data.DataTable();
table.Columns.Add("RequestID", typeof(int));
table.Columns.Add("Age", typeof(int));
table.Columns.Add("User Name ", typeof(string));
table.Columns.Add(" Target", typeof(string));
table.Columns.Add(" Resource", typeof(string));
table.Columns.Add(" Atribute value", typeof(string));
table.Columns.Add("Role", typeof(string));
table.Columns.Add("Status", typeof(string));
table.Columns.Add("Approver Status", typeof(string));
table.Rows.Add(1, 2, "M", "M", "M", "M", "M", "M", "M");
return table;
}