Hi,
I came across your product through google. We needed a way to read and export excel data to sql server.
I found this article
which works perfectly. I was just wondering how possible is it to allow users to browse for the excel file rather than accessing it through the c drive.
//Instantiating an Workbook object
Workbook workbook = new Workbook();
//Creating a file stream containing the Excel file to be opened
FileStream fstream = new FileStream("C:\\book1.xls",FileMode.Open);
//Opening the Excel file through the file stream
workbook.Open(fstream);
//Accessing the first worksheet in the Excel file
Worksheet worksheet = workbook.Worksheets[0];
//Exporting the contents of 7 rows and 2 columns starting from 1st cell to DataTable
DataTable dataTable = worksheet.Cells.ExportDataTableAsString(0,0,7,2,true);
//Binding the DataTable with DataGrid
dataGrid1.DataSource = dataTable;============added by me
//Closing the file stream to free all resources
fstream.Close();
I am using the evaluation copy of the program - trying before buying.
Thanks.