2

I have the following database defined in app.config now:

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\table.mdb

can I use excel instead as datasource there? are there any limits if I use excel file, the database is simple 300 rows, and it would be more handy to use excel file.

does excel need to be readonly?

1
  • Why would you want to use a shared xl file for a db, if you need it to store and retrieve data use xml which is much more accessible, better in performance and compatible in computers that doesn't have office installed (unless there are other purposes). Commented Sep 14, 2009 at 8:30

2 Answers 2

4

Yes you can use Excel as a Data Source.

e.g. Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MyExcel.xls;Extended Properties="Excel 8.0;HDR=Yes;IMEX=1";

The details can be found at http://www.connectionstrings.com/excel

The document doesn't need to be readonly

Sign up to request clarification or add additional context in comments.

1 Comment

[Sheet1$] is the name of the first sheet If you have a named range I believe they exist as table names (if memory serves, has been a long time since I used these).
0

Why would you want to use a shared xl file for a db, if you need it to store and retrieve data use xml which is much more accessible, better in performance and compatible in computers that doesn't have office installed (unless there are other purposes).

Anyway, this is not a problem, take a look here: http://support.microsoft.com/default.aspx/kb/295646

The document doesn't have to be readonly but as I remember from last time I used it, it will get stuck if you open the file.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.