2013-06-27 53 views
0

我已經爲我的C#應用​​程序進行了設置,但是當我將它安裝在另一臺計算機上時,它向我顯示Path無效的錯誤。我使用了下面的代碼。如何將數據庫添加到安裝程序在c#

 public string Path1 = (@"|DataDirectory|\MakeMyBill.sdf"); 
     SqlCeConnection conn = new SqlCeConnection(Path3); 
     conn.Open(); 

回答

0

如果您的應用程序創建安裝之前運行良好,你只是問路,包括在建立數據庫,則─

- I put the database with exe [in bin->debug folder] 
- and while creating setup i put the database in Application folder with .exe. 
    [as you know there are 3 parts in file system -Application folder , user's desktop and user's program menu] 
相關問題