Click here to Skip to main content
11,637,176 members (70,727 online)
Click here to Skip to main content

Export excel data to a Dataset

, 27 Nov 2003 207.4K 8.4K 66
Rate this:
Please Sign up or sign in to vote.
A usercontrol that exports from excel to a dataset without needing MS office to be installed.

Introduction

If you ever need to add functionality to your application to enable you to export an excel file as a Dataset, instead of coding it by yourself, use this control. Using this you can let the user select the column names of the datatable in the exported Dataset. You can also restrict the user to select column names from a list of specified column names.

Background

This control uses System.Data.OleDbClient namespace to connect to the excel file as a data store. It doesn't need MS Excel to be installed on the computer.

Using the code

  1. Copy Gopal.Data.Transform.dll to your application folder. Right click on the toolbox and select 'Add/Remove components' as shown below.

  2. Now select 'ExcelExportControl' from 'Gopal.Data.Transform' assembly and press 'OK' as shown below.

  3. The 'ExcelExportControl' has now been added to the toolbox and can be used.

  4. This control will now allow you to load an excel file. You can select the first row as the column names by checking the checkbox which says so.
  5. The first tabpage lets you preview all the sheets in the excel file.

  6. The second tabpage lets you select an output dataset name, datatable name and column names too.

The download package has the source code, assembly and a demo form using the assembly.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

ksgopal
Web Developer
United Kingdom United Kingdom
No Biography provided

You may also be interested in...

Comments and Discussions

 
GeneralExport to excel through user control Pin
preetej30-Jul-08 19:38
memberpreetej30-Jul-08 19:38 
GeneralExport to Dataset Pin
BarbaMariolino14-May-08 3:45
memberBarbaMariolino14-May-08 3:45 
Questionis it possible to use it withot the gui ? Pin
Member 15181679-May-08 2:52
memberMember 15181679-May-08 2:52 
AnswerRe: is it possible to use it withot the gui ? Pin
CikaPero4-Sep-11 21:22
memberCikaPero4-Sep-11 21:22 
Questionhow to view /access the exported dataset Pin
k.philip4-Oct-07 21:09
memberk.philip4-Oct-07 21:09 
AnswerRe: how to view /access the exported dataset Pin
k.philip4-Oct-07 21:15
memberk.philip4-Oct-07 21:15 
Questionhow to set datatype of imported Excel sheet Pin
jaganil1-Aug-07 2:01
memberjaganil1-Aug-07 2:01 
NewsUpdate to read csv and tab delimited files Pin
the bill11-May-07 23:42
memberthe bill11-May-07 23:42 
GeneralRe: Update to read csv and tab delimited files Pin
Peter Nevill18-Jul-07 19:58
memberPeter Nevill18-Jul-07 19:58 
QuestionCode sometimes Wont get the OLEDB Schema Pin
Simple but Effective15-Aug-06 0:55
memberSimple but Effective15-Aug-06 0:55 
Questionhow to import Excel file data in c# Pin
JayGosavi7-Aug-06 21:41
memberJayGosavi7-Aug-06 21:41 
AnswerRe: how to import Excel file data in c# Pin
alex.almeida4-Apr-07 10:21
memberalex.almeida4-Apr-07 10:21 
AnswerHi to all Pin
anuragji2001018-Jul-11 22:06
memberanuragji2001018-Jul-11 22:06 
GeneralAlternative way Pin
Jan Gex19-Dec-05 5:46
memberJan Gex19-Dec-05 5:46 
GeneralNice Very Very Usefull Pin
vivekthangaswamy7-Jul-05 23:29
membervivekthangaswamy7-Jul-05 23:29 
QuestionHow can I use dataset to Excel? Pin
Peter Sze29-Dec-04 16:13
memberPeter Sze29-Dec-04 16:13 
AnswerRe: How can I use dataset to Excel? Pin
Anonymous15-Jun-05 22:54
sussAnonymous15-Jun-05 22:54 
Generaldo you have code in VB.net Pin
koonlee27-Aug-04 1:56
memberkoonlee27-Aug-04 1:56 
GeneralOnly 255 chars Pin
Al. Ceausu5-Aug-04 18:26
memberAl. Ceausu5-Aug-04 18:26 
GeneralRe: Only 255 chars Pin
jasperp30-May-07 20:06
memberjasperp30-May-07 20:06 
Generalnumeric field values are not retrieved Pin
DaberElay30-Jul-04 0:06
memberDaberElay30-Jul-04 0:06 
GeneralRe: numeric field values are not retrieved Pin
DaberElay31-Jul-04 5:56
memberDaberElay31-Jul-04 5:56 
GeneralRe: numeric field values are not retrieved Pin
Vinay K. Ladwal21-Aug-06 3:57
memberVinay K. Ladwal21-Aug-06 3:57 
GeneralRe: numeric field values are not retrieved Pin
DaberElay21-Aug-06 9:26
memberDaberElay21-Aug-06 9:26 
QuestionRe: numeric field values are not retrieved Pin
Vinay K. Ladwal22-Aug-06 0:29
memberVinay K. Ladwal22-Aug-06 0:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.150728.1 | Last Updated 28 Nov 2003
Article Copyright 2003 by ksgopal
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid