0

Hi
I have project which involve a database and a folder in which i will store the images which paths are stored in database.
When i make a setup copy of my project and run it gives the following error.
COULD NOT FIND FILE 'C:\DOCUMENT AND SETTINGS\ADMINISTRATOR\ISO.mdb'
while i have declared the connection string as

OleDbConnection mycon = new OleDbConnection("Provider=Microsoft.JET.OLEDB.4.0; Data Source=ISO.mdb");

and this line also does not work

string pathing = AppDomain.CurrentDomain.BaseDirectory + "Images_of_Student\\Image_" + name;

what is the solution of my problem.
thnx in advance

3
Contributors
5
Replies
6
Views
7 Years
Discussion Span
Last Post by sknake
0

well here you have to give the path where you will be install your application.
for example:

Data Source=C:/program Files/Default company name/setup/iso.mdb

You can change this path at the time of making the setup file..........

Hope it works.......:)

Edited by avirag: n/a

0

And one more thing,
must add your database and image folder including your project at the time when you make setup..........

0

but if the users windows is installed in 'D' instead of 'C'. Then how this line of code does work.

Data Source=C:/program Files/Default company name/setup/iso.mdb
0

well that is not a problem then, it will create this folder(path) for user....
well you just give this path in your application,
Hope your problem will solve......:)

0

You shouldn't hard code filenames like that. Have a "Settings" form where the user can invoke an OpenFileDialog() and select the database file. Store the FileName/FullName property to a string value in your application configuration file.

This article has been dead for over six months. Start a new discussion instead.
Take the time to help us to help you. Please be thoughtful and detailed and be sure to adhere to our posting rules.