2015-11-12 127 views
0

我想知道我遇到過這個問題的瀏覽器的歷史記錄。 我得到的錯誤是行using (SQLiteDataReader dr = cmd.ExecuteReader())顯示Database is lockedSQL數據庫被鎖定

順便說一句,我讀了相關的職位,我的錯誤,我仍然無法解決它。

using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Text; 
using System.Data.SQLite; 

namespace CrawlHistory 
{ 
    class Program 
    { 
     static void Main(string[] args) 
     { 
      using (SQLiteConnection conn = new SQLiteConnection(@"Data Source=C:\Users\ASUS\AppData\Local\Google\Chrome\User Data\Default\History")) 
      { 
       conn.Open(); 
       using (SQLiteCommand cmd = new SQLiteCommand()) 
       { 
        cmd.Connection = conn; 
        cmd.CommandText = "Select * From urls"; 
        using (SQLiteDataReader dr = cmd.ExecuteReader()) 
        { 
         while (dr.Read()) 
         { 
          Console.WriteLine(dr[1].ToString()); 
         } 
        } 
       } 
      } 

     } 
    } 
} 
+1

是...... Chrome ...仍在運行?也在後臺... –

+0

@AdrianoRepetti。否 – user3233712

+0

您是否有併發訪問您的數據庫文件? SQLite在處理它不是很好。 –

回答

0

已解決。它沒有任何問題。你應該確定你已經關閉了「Chrome」。你可以從'任務管理器'檢查它