Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: C#
c# code for how to insert total excel coloumn in database
Posted 26-Dec-12 23:39pm
Oleksandr Kulchytskyi at 27-Dec-12 5:54am
What do you mean ???
Total count of collumns on one sheet??
Or all columns (it's name )???
IpsitaMishra at 27-Dec-12 6:07am
I thought you want to insert all the column(and daterows) of excel sheet to one of the table in the your db .Is it :)

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Try this it may help you
string connectionString = GetConnectionString();
                        OleDbConnection connection = new OleDbConnection(connectionString);
                        OleDbDataAdapter adapter = new OleDbDataAdapter("SELECT * FROM [Sheet2$]", connection);
                        DataTable dtImprtExcel = new DataTable();
after that use the table ds to fill your datatable

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 CHill60 185
1 Sarvesh Kumar Gupta 185
2 OriginalGriff 179
3 George Jonsson 154
4 ArunRajendra 144

Advertise | Privacy | Mobile
Web04 | 2.8.140709.1 | Last Updated 27 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid