Connection string with relative path to the database file

后端 未结 10 781
暗喜
暗喜 2020-11-28 07:20

I load data from sdf database in winforms App. I use full path to the database file . Example :

conn = new SqlCeConnection

{

ConnectionString =\"Data Sou         


        
10条回答
  •  余生分开走
    2020-11-28 07:59

    I did this in the web.config file. I added to Sobhan's answer, thanks btw.

    
        
      
    

    Where "db" becomes my database directory instead of "App_Data" directory.

    And opened normally with:

    var db = Database.Open("listdb");

提交回复
热议问题