Click here to Skip to main content
15,909,822 members
Home / Discussions / C#
   

C#

 
Generalunsorted column schema Pin
paulb17-Jan-05 16:10
paulb17-Jan-05 16:10 
GeneralDetect sender page Pin
ABBASI_RA17-Jan-05 15:35
ABBASI_RA17-Jan-05 15:35 
GeneralRe: Detect sender page Pin
Stefan Troschuetz18-Jan-05 0:21
Stefan Troschuetz18-Jan-05 0:21 
Generaldatagrid lookup field Pin
ABBASI_RA17-Jan-05 15:33
ABBASI_RA17-Jan-05 15:33 
GeneralExcel database for C# Pin
Syasya Mortensen17-Jan-05 14:06
Syasya Mortensen17-Jan-05 14:06 
GeneralRe: Excel database for C# Pin
Christian Graus17-Jan-05 15:55
protectorChristian Graus17-Jan-05 15:55 
GeneralRe: Excel database for C# Pin
Syasya Mortensen17-Jan-05 16:22
Syasya Mortensen17-Jan-05 16:22 
GeneralRe: Excel database for C# Pin
Rob Graham17-Jan-05 17:02
Rob Graham17-Jan-05 17:02 
You can do this with ADO.Net. Just change the connection string to :
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\myfiles\\myworkbook.xls;Extended Properties=\"Excel 8.0;\""
(note the escaped backslash and quote characters. Data Source needs to be full path to the workbook file, UNC paths are ok if you have sufficient permissions to the location).
Table Name will be the worksheet name with '$" appended (e.g [Sheet1$] ).

If the spreadsheed contains mixed numeric and text data in the same column, you may wish to add to the "extended properties part IMEX =1
( ";Extended Properties=\"Excel 8.0;IMEX=1\"") to force all the columns to map to string data types (otherwise things get ugly when a column is misidentified as numeric and a non-convertible string is encountered after the first 8 rows or so).

Good luck.

Anger is the most impotent of passions. It effects nothing it goes about, and hurts the one who is possessed by it more than the one against whom it is directed.
Carl Sandburg

GeneralRe: Excel database for C# Pin
Syasya Mortensen25-Jan-05 13:59
Syasya Mortensen25-Jan-05 13:59 
GeneralNovell C# LDAP - Thread does not own the semaphore exception Pin
Edbert P17-Jan-05 12:33
Edbert P17-Jan-05 12:33 
General.NET Version Pin
Edbert P17-Jan-05 13:53
Edbert P17-Jan-05 13:53 
GeneralFormating doubles Pin
Flack17-Jan-05 11:43
Flack17-Jan-05 11:43 
GeneralRe: Formating doubles Pin
Christian Graus17-Jan-05 12:25
protectorChristian Graus17-Jan-05 12:25 
GeneralRe: Formating doubles Pin
Stefan Troschuetz17-Jan-05 21:13
Stefan Troschuetz17-Jan-05 21:13 
GeneralWindows Installer questions... Pin
new_phoenix17-Jan-05 11:24
new_phoenix17-Jan-05 11:24 
GeneralRe: Windows Installer questions... Pin
Heath Stewart18-Jan-05 10:16
protectorHeath Stewart18-Jan-05 10:16 
GeneralAppending DataTable Pin
myNameIsRon17-Jan-05 11:10
myNameIsRon17-Jan-05 11:10 
GeneralRe: Appending DataTable Pin
Heath Stewart18-Jan-05 10:18
protectorHeath Stewart18-Jan-05 10:18 
Generalpropertygrid with browsable Pin
GoodQuestion17-Jan-05 11:04
GoodQuestion17-Jan-05 11:04 
GeneralRe: propertygrid with browsable Pin
Heath Stewart18-Jan-05 10:27
protectorHeath Stewart18-Jan-05 10:27 
GeneralDateTime Save null Pin
webhay17-Jan-05 9:24
webhay17-Jan-05 9:24 
GeneralRe: DateTime Save null Pin
Christian Graus17-Jan-05 9:58
protectorChristian Graus17-Jan-05 9:58 
GeneralRe: DateTime Save null Pin
Heath Stewart17-Jan-05 10:58
protectorHeath Stewart17-Jan-05 10:58 
GeneralRe: DateTime Save null Pin
webhay17-Jan-05 11:46
webhay17-Jan-05 11:46 
GeneralRe: DateTime Save null Pin
Christian Graus17-Jan-05 12:29
protectorChristian Graus17-Jan-05 12:29 

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

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