Click here to Skip to main content
15,843,727 members
Please Sign up or sign in to vote.
4.00/5 (2 votes)
See more:
hi all

i am implementing a window application for getting firefox browsing history.
i know that task complete by open or access "placess.sqlite" in c#.net
but i have problem i use the code below :

using system.data.sqlite;

SQLiteConnection sql_con;
SQLiteCommand sql_cmd;
SQLiteDataAdapter DB;
DataTable DT = new DataTable();

string dbpath="C:\Users\administrator\AppData\Roaming\Mozilla\Firefox\Profiles\2f92gtpv.default\places.sqlite"

dbPath = dbPath.Replace("places.sqlite", "places");

sql_con = new SQLiteConnection("Data Source=" + dbPath +
";Version=3;New=False;Compress=True;");

// Open the Connection
sql_con.Open();//here connection open successfuly and its state show open
sql_cmd = sql_con.CreateCommand();


// Select Query
string CommandText = "select * from moz_places";

// Populate Data Table
DB = new SQLiteDataAdapter(CommandText, sql_con);
DB.Fill(DT);

but when populate data from table i got error:SQLite error
no such table: moz_places


even places.sqlite database is perfectly open in sqlite manger and i can write query there and its provide result in well maner

if anyone have any solution please provide perfect solution
Please Help me i am struggling lot on that topic


thanx & regards
Sanjay
Posted
Comments
Richard MacCutchan 27-Dec-13 4:56am    
Then you need to change your query to use the correct table name.

1 solution

You are targeting a wrong file. The file that you want to use is places.sqlite not places so don't replace the name .
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900