大家好
 
最近遇到一個問題
因為我接前同事寫的程式
但是我對於C#經驗不多
看到它裡面有寫入資料庫
且資料庫是類似 sqlite 那樣的本地端資料庫檔案
覺得相當特別...
 
但是一時之間找不到讀取 SDF檔案的方法
 
一開始有看到有人建議  LINQPad 這軟體
 
 
 
Download and install LINQPad, it works for SQL Server, MySQL, SQLite and also SDF (SQL CE 4.0).
 
Steps for open SDF Files:
 
  1. Click Add Connection
  2. Select Build data context automatically and Default (LINQ to SQL), then Next.
  3. Under Provider choose SQL CE 4.0.
  4. Under Database with Attach database file selected, choose Browse to select your .sdf file.
  5. Click OK.
 
 
但是用一用發現
確實可以讀取...但是要匯出什麼的都很麻煩
且有鎖定功能,他是要收費的軟體...
 
所以我後來又找一找
發現 visualstudio 本身就可以讀取SDF且功能完整了
 
SQLite/SQL Server Compact Toolbox
 
安裝後就會出現
 

 
 
左邊就有工具箱
 

 
打開之後輸入 檔案位置 與 大小 與 密碼
就可以存取囉!
 
 

 
也有匯出語法 
有這些基本語法方便很多
 
 

 
給大家參考囉!
感恩