Click here to Skip to main content
Sign Up to vote bad
good
Dear Expert's,
 
I am Doing a .Net winForms Application. Now am stuck with a Problem. When i Import Excel, Everything is working fine expect one thing.
 
I didn't get the correct datas when i import (Only the time HDR = YES)
 
Eg: Excel Datas = "Invoice No."
After Import = "Invoice No#"
 
Dot(.) is changed to Hash (#).
 
And i need header thats y am using HDR = yes in connection string.
 
Please help me to get the correct datas when i import.
 
My connection string
 
connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & fileName & ";Extended Properties=""Excel 8.0;IMEX=1;HDR=YES;"""
 
.........
 
Thanks and Regards
 
Dileep
Posted 27 Jan '13 - 19:52
dilzz1.1K
Edited 27 Jan '13 - 20:12

Comments
Richard MacCutchan - 28 Jan '13 - 6:13
I have just tried this and get exactly the same result, but I don't know why it happens.

1 solution

I think you use OLEDB... If yes, then connection string is OK, but you need to change a query. Below query should works perfect:
 
SELECT [Invoice No#] AS [Invoice No.], [Field2], [Field3]
FROM [Sheet1$]
  Permalink  

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

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 OriginalGriff 325
1 Abhinav S 168
2 Sergey Alexandrovich Kryukov 150
3 Ron Beyer 100
4 Zoltán Zörgő 85
0 Sergey Alexandrovich Kryukov 8,386
1 OriginalGriff 6,596
2 CPallini 3,533
3 Rohan Leuva 2,703
4 Maciej Los 2,234


Advertise | Privacy | Mobile
Web01 | 2.6.130516.1 | Last Updated 12 Feb 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid