Import Excel files to SQL Server dynamically

This article shows how to import Excel files to SQL Server dynamically.

Introduction

This article will show you how to import an Excel file to SQL Server, dynamically, without the need to open the Import wizard from SQL Server. This could be of great help if you have a lot of Excel files to import.

Using the code

First, create the Datamanage class that holds the import code. The “excelCommand” will create a new table in the SQL Server database, taking into consideration the names and data types of the Excel file fields.

Hi , i've tried the code you have written . but i found the error .i have make sure about Server , database, table , username and password .but found error "Error = ODBC---Call Failed"please kindly need your help to solve the error .