By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,166 Members | 1,575 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,166 IT Pros & Developers. It's quick & easy.

Installation and File Path

P: n/a
Hello:

My program displays a Datagrid which is populated from an excel file. It is
done to show the end user a sample file. How can I reference the excel file
in the program connection string so that it can read it from the application
folder after install. I guess my question would be, how do i make it
independent of the path the user chooses to install the program.

Thank You
Prasun
Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hi,

Hard code the path in the connection string

"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" _
"C:\MySheet.xls;Extended Properties=Excel 8.0; HDR = YES;"

Ken
=======================

"Prasun" <pr******@csufresno.edu> wrote in message
news:%2******************@TK2MSFTNGP15.phx.gbl...
Hello:

My program displays a Datagrid which is populated from an excel file. It is
done to show the end user a sample file. How can I reference the excel file
in the program connection string so that it can read it from the application
folder after install. I guess my question would be, how do i make it
independent of the path the user chooses to install the program.

Thank You
Prasun

Nov 21 '05 #2

P: n/a
Prasun,

Use the applicationstartup path in your connectionString and place the Excel
sheet there.

http://msdn.microsoft.com/library/de...ppathtopic.asp

In my opinion the most easy solution. However you get than the same (in my
opinion) ugly solution as done with all those Microsoft development tools,
where the usable data is in the Program Files.

Cor
Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.