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.
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

Recommended Answers

All 5 Replies

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.......:)

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

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

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......:)

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.