hi
The code blow is sample form MSDN, But it doesn't work ,Help me
DataTable table = new DataTable("Employees");
private void Sheet1_Startup(object sender, System.EventArgs e)
{
table.Columns.Add("FirstName", typeof(string));
table.Columns.Add("LastName", typeof(string));
table.Columns.Add("Title", typeof(string));
table.Rows.Add("Nancy", "Anderson", "Sales Representative");
table.Rows.Add("Robert", "Brown", "Sales Representative");
Microsoft.Office.Tools.Excel.ListObject List1 =
this.Controls.AddListObject(this.Range["A1", "B3"], "List1");
List1.AutoSetDataBoundColumnHeaders = true;
List1.SetDataBinding(table, "Title", "LastName", "FirstName");
List1.Disconnect();
}
the red code throw an Exception