TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Rob
NA
1
0
Accessing Excel from C#
Feb 23 2007 11:02 AM
I am currently accessing a large excel file from C# using OLE in order to export it to a CSV file. I read in the excel file, process the data, and then output it. The XLS file causes an "Unexpected error from external Database driver (22)." If I open and resave the file in excel, the error is no longer produced. Any suggestions? The code that I am using to do this follows: m_ConnectionToExcelBook = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + openFileDialog1.FileName + ";Extended Properties='Excel 8.0;'"); m_AdapterForExcelBook = new OleDbDataAdapter(); returnDataObject = new DataTable(); //Connect to Excel File m_ConnectionToExcelBook.Open();
Reply
Answers (
0
)
how to access machine.config in C# code ?
How to change drive's volume serial in C#