SQL Server - I want to import excel file in sql server2008R2

Asked By A Keyvi on 21-Nov-12 08:42 AM
I want to import excel file in sql server2008R2 with Import and export Data(32-bit) program.at the end I get this error for any columns
- Validating (Error)
      Messages
      Warning 0x802092a7: Data Flow Task1: Truncation may occur due to inserting data flow column "name" with a length  of 255 to database column "name" with a length of 60.
...
...
     Thanks.
White Ashlin replied to A Keyvi on 22-Nov-12 01:36 AM
Actually, if you do not put your code here, no one can reproduce your problem, Also you do not tell which library you use. So I have to use the tool that I am familiar. look at this, it can import excel data to datatable and then, you can connect datatable  with sql server by below code:
             Workbook workbook = new Workbook();
            workbook.LoadFromFile(@”..\FandH.xlsx”);
            Worksheet sheet = workbook.Worksheets[0];
            this.dataGridView1.DataSource = sheet.ExportDataTable();
http://www.codeproject.com/Catalogs/3785/Spire-XLS.aspx
A Keyvi replied to White Ashlin on 22-Nov-12 02:33 AM
thank you for great help
I use SQL Server Import and export Data(32-bit) , this is a wizard program and no need a code .