Search code examples
c#.netwindowssqlitesetup-project

Unable to open the Sqllite DB file when lancuhing the application


I used the PostBuildevnt script to launch the application form link

http://blogs.msdn.com/b/astebner/archive/2006/08/12/696833.aspx?wa=wsignin1.0&CommentPosted=true

and launching the app successfully.I am using the sqllite for app. I added the DB file in Application Folder/DataBase and using the following code to open the Db file.

string ConnectionString = "data source=" + Path.GetFullPath(".") + "\\DataBase\\CATTDB.db";

If i launch the app from the installation wizard,it is not connecting to db file.it is throwing the error like "Unable to open the file".

If i launch from the start menu or desktop icon ,it is working fine..

What is the problem here? please help me..


Solution

  • All the files are copying correctly..

    I tried with Application.ExecutablePath instead of Path.GetFullPath(".")

    it work's great...