Reputation: 6707
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?
Upvotes: 2
Views: 18474
Reputation: 104721
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.
Upvotes: 0
Reputation: 12495
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
Upvotes: 4