Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 58475
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T17:51:13+00:00 2026-05-10T17:51:13+00:00

Does anyone know how to write to an excel file (.xls) via OLEDB in

  • 0

Does anyone know how to write to an excel file (.xls) via OLEDB in C#? I’m doing the following:

   OleDbCommand dbCmd = new OleDbCommand('CREATE TABLE [test$] (...)', connection);    dbCmd.CommandTimeout = mTimeout;    results = dbCmd.ExecuteNonQuery(); 

But I get an OleDbException thrown with message:

‘Cannot modify the design of table ‘test$’. It is in a read-only database.’

My connection seems fine and I can select data fine but I can’t seem to insert data into the excel file, does anyone know how I get read/write access to the excel file via OLEDB?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T17:51:14+00:00Added an answer on May 10, 2026 at 5:51 pm

    You need to add ReadOnly=False; to your connection string

    Provider=Microsoft.Jet.OLEDB.4.0;Data Source=fifa_ng_db.xls;Mode=ReadWrite;ReadOnly=false;Extended Properties=\'Excel 8.0;HDR=Yes;IMEX=1\'; 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know how to write a Regex.Split in order to convert {video=my/video/file.flv,my/location.jpg} into
I'm faced with the need to write a new MIB description. Does anyone know
Does anyone know how to write this var q = from c in customers
Does anyone know if it is feasible to write a Generic JMS client -
Does anyone know of any good tools (I'm looking for IDEs) to write assembly
Does anyone know a good C++ class to read (and possibly also write) INI
Does anyone know of an existing ruby implementation of a read/write lock - http://en.wikipedia.org/wiki/Readers-writer_lock
Does anyone know what is required to be able to read and write to
I want to write a real-time analysis tool for wireless traffic. Does anyone know
Does anyone know how to write a script in stored proc to run the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.