I have a requirement where in I have to upload all excel data into a table in sql server database. Also while doing this I have to check for dulication.
Ex: Say I have Firstname, Lastname and Email in Excel. I have to import same data into my table in Sql Database but EmailID shouldn't have existed before.
shreyasrs
Member
5 Points
20 Posts
Import Excel Data into a table in Sql server database.
Dec 18, 2012 06:29 AM|LINK
Hi All,
I have a requirement where in I have to upload all excel data into a table in sql server database. Also while doing this I have to check for dulication.
Ex: Say I have Firstname, Lastname and Email in Excel. I have to import same data into my table in Sql Database but EmailID shouldn't have existed before.
SohailShaikh
Contributor
6129 Points
1172 Posts
Re: Import Excel Data into a table in Sql server database.
Dec 18, 2012 06:35 AM|LINK
use SQL DTS or SSIS and import email column only from excel file
http://www.aspdotnet-suresh.com/2010/09/import-data-from-excel-to-sql-database.html
Sohail Shaikh
Sharon59
Member
180 Points
31 Posts
Re: Import Excel Data into a table in Sql server database.
Dec 18, 2012 06:54 AM|LINK
Workbook workbook = new Workbook(); workbook.LoadFromFile(@”D:\Work\My Documents\Sales Report.xlsx”); Worksheet sheet = workbook.Worksheets[0]; sheet.ExportDataTable();Code from this post: http://janewdaisy.wordpress.com/2011/11/29/c-export-data-from-excel-to-datatable/