Reputation: 1
I Have created a c# application which is using access database.
I have deploy the application successfully.
what I want is install the access database automatically in other users computer automatically.
I have tried to change the app.config files connection string and no use..:(
help me
Upvotes: 0
Views: 7233
Reputation: 10623
If you want to create .exe Setup Project of your Dot Net Application which is using MS Access DATA BASES. then simply follow this steps. Please read this one for a moment before to proceed these steps.Connect with MS Access Data Base in Dot net. When you are going to create the exe file then your data base connection string should be like this(means there should be no directory in @"Data source, Just direct put the name of your data base, because in .exe file when you add your data base file, then it is in the same directory.
System.Data.OleDb.OleDbConnection conn = new System.Data.OleDb.OleDbConnection();
conn.ConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;" +
@"Data source=MyDataBase.accdb";
Upvotes: 0
Reputation:
Copy the access db to a folder in programdata with the setup. Connect to this db in your code. You don't need a connectionstring in app.config if the user is not allowed to specify the db path.
Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData);
Your setup should be able to deploy to a programdata folder.
Upvotes: 0
Reputation: 1276
Not sure what you mean, but if your database is part of your solution you can copy it to the output directory:
Upvotes: 1
Reputation: 181
You have to be more specific. Did you install the application using installer? Copying and pasting?
Maybe these would help:
Upvotes: 0