Reputation: 2378
I use ExcelLibrary to create an excel from a DataSet
. I use the below code to create a DataSet
and create Excel.
DataTable dtTable = new DataTable();
dtTable.Columns.Add(new DataColumn("name", typeof(string)));
DataRow dr = dtTable.NewRow();
dr[0] = "test";
dtTable.Rows.Add(dr);
DataSet ds = new DataSet();
ds.Tables.Add(dtTable);
ExcelLibrary.DataSetHelper.CreateWorkbook(textBox1.Text, ds);
But when the excel is created, there are no rows in Excel.
Upvotes: 0
Views: 1788
Reputation: 21
Give a name to your datatable. That will create the sheet name dtTable.TableName = "Sheet1"
Upvotes: 0