Solved

Remove Headers in Excel

Posted on 2004-08-06
8
293 Views
Last Modified: 2010-04-23
Hi everyone:

How to remove headers (total 11 fileds) from Excel through VB.NET code before dumping data into SQL table.

RGDS
Sam
0
Comment
Question by:BOOBIC
  • 4
  • 2
  • 2
8 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 11739280
I think this is what you mean.


In the connection string:

Extended Properties="Excel 8.0;HDR=Yes;IMEX=1"

HDR=Yes; indicates that the first row contains columnnames, not data
IMEX=1; tells the driver to always read "intermixed" data columns as text

Bob
0
 

Author Comment

by:BOOBIC
ID: 11739477
Yes, that's what you have in connection string and only one line of header. But in my case I have 11 lines of headers describing name of the file, date of creation, company name, ....I have to remove them all in order to dump data into SQL.

RGDS
Sam
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 11739533
How are you "dumping" to SQL?

Bob
0
 

Author Comment

by:BOOBIC
ID: 11739702
I didn't wrote any code yet.

Sam

0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 4

Accepted Solution

by:
Jigit earned 100 total points
ID: 11745769
1. Save the Excel file as CSV ( worksheet.SaveAs() ) - comma separated text file
2. Open the CSV file programmatically for reading
3. Ignore header lines and then start dumping into SQL

HTH,
Jigit
0
 

Author Comment

by:BOOBIC
ID: 11776752
Hi Jigit:

Thank you for you message. This one of the methods to use. In my app, I have to do it on Proccess_Click event (one click). I got the solution for that.

Thank you.

Sam  
0
 
LVL 4

Expert Comment

by:Jigit
ID: 11824444
BOOBIC, thank you for accepting my answer and grading it A. Would you like to fill some feedback?

Thanks,
Jigit
0
 

Author Comment

by:BOOBIC
ID: 11825993
I dumped data into SQL and used Delete statement for the rows i would like to be removed.  This not that sofisticated but it does the trick. I needed to move quick with that project. And my question is opened in any way. How to do that right.

RGDS
Sam
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Sign PDF document with digital PFX file from VB.NET 2010 1 27
Showdialog 8 29
Convert to Hour/minute textbox and compare 3 52
fso.FolderExists("\\server\HiddenFolder$") 4 46
I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now