sqlite

How can you access the contents of Android Emulator databases?

I've read the answer to a question as to how to access the contents of the databases, however I cannot seem to get it to work on my machine. Here is the shell log: C:\android-sdk-windows\tools>adb -s emulator-5554 shell # sqlite3 /data/data/com.android.demo.notepad2/databases/notes sqlite3 /data/data/com.android.demo.notepad2/databases/...

Does sqlite3 support a trigger to automatically update an 'updated_on' datetime field?

I have a table that looks like this user_id | name | created_on | updated_on -------------------------------------------------- 1 | Peter D | 1/1/2009 | If I insert or update a record, I'd like a trigger to update the updated_on field with datetime('now'). But I can't find the function name to target the most re...

FluentNHibernate SQLite default config ProxyFactoryFactory

Hello I want a simple unit test configuration. My understanding is that the sqlite fluent config defaults to Castle, and I have a reference set to NHibernate.ByteCode.Castle.dll, yet I am getting an error saying there is no ProxyFactory setting set. What am I missing? Cheers, Berryl === the CODE === public abstract class InMemoryDat...

How to join SQL tables while selecting a COUNT() function?

I have two database tables, 'Lists' and 'Notes'. Lists has columns _id, listname Notes has columns _id, checked, list_id (which is a foreign key of Lists._id), and more columns that aren't relevant to this question. I would like to create a query that returns four columns: Lists._id, Lists.listname, the count of all checked Notes in thi...

Sqlite Subsonic C#: Guid is saving as Guid with SQL, but with strange characters when using code

I am using System.Data.SQLite with an sqlCommand String, this saves a Guid as expected. Using code I strange Characters save instead of Guid as follows: ù“•»I={E±gÒ §[, Code that seems to generate strange characters (as seen in SQLite Administrator): ... // Constructor in Class public ProfileUserAssignment() { ID =...

C# SQLite SubSonic: Adding/Updating seems to change ID?

I have a basic object for saving to SQLite using SubSonic, the Save method is shown below... Adding and Updating the repository works, I then gave a Get Method that returns then gets the object back out the repository using its ID, however the ID at that point (on "this") has changed. Note: the ID type is a string representing a Guid. ...

C# SubSonic SQLite: NullReferenceException on Update

I have seen some older posts similar to this, but I seem to be getting this using SQLite rather than SQL Server. I think the version is 3.0.0.3. I am doing an update on an object, in this particular case, the object is passed into a form and saved there...Save() method to repository is on the same class. I have checked the properties b...

Managing database connections in an Android Activity

I have an application with a ListActivity that uses a CursorAdapter as its adapter. The ListActivity opens the database and does the querying for the CursorAdapter, which is all well and good, but I am having issues with figuring out when to close both the Cursor and the SQLiteDatabase. The way things are handled right now, if the user...

Values of passed in variables don't retain

I'd like to split up executing a query. The myprepare function below opens the database connection and runs the sqlite3_prepare_v2 function. Once sqlite3_open is executed within the scope of the myprepare, selectstmt and database have valid addresses assigned to them. However, once I come out of myprepare, their addresses are wiped t...

Keeping track of "prices" in a SQLite database?

My Schema looks like this: CREATE TABLE items ( id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL, description TEXT NOT NULL, quantity INTEGER NOT NULL price TEXT NOT NULL, category_id INTEGER NOT NULL ); CREATE INDEX "item_id" ON "items" ("id"); I'm setting price as TEXT but it probably should ...

C# SQLite: Do I need to deploy System.Data.SQLite.xml?

Do I need to deploy System.Data.SQLite.xml with the System.Data.SQLite dlls? The xml gets included when referencing the dlls copied to the bin folder. ...

Best way to implement SQLite data storage in AIR

What would be the best way to commit data to an SQLite database in AIR? I currently have an NamesCollection class which extends ArrayCollection. The addItem method takes the name as a parameter and passes it on to the addItem method of the base class, then writes it to the database using the flash.data.* API. I would also like to use da...

SQLite DateTime comparison

I can't seem to get reliable results from the query against a sqlite database using a datetime string as a comparison as so: select * from table_1 where mydate >= '1/1/2009' and mydate <= '5/5/2009' how should I handle datetime comparisons to sqlite? update: field mydate is a DateTime datatype Solution: following the datetime ...

Notepad tutorial

This is truly a beginner's question. I installed and successfully ran the notepad tutorials Notepadv1,2,3 and typed in a few notes. Can i import data (manually )from an external text file into the sq lite dbs? I looked in my Notepadv workspace folders but no dbs seem to have been created? I looked for anything with .db extension or nam...

Rolling rows in SQL table

I'd like to create an SQL table that has no more than n rows of data. When a new row is inserted, I'd like the oldest row removed to make space for the new one. Is there a typical way of handling this within SQLite? Should manage it with some outside (third-party) code? ...

Remove slashes from sqlite

Hi I am creating an application in Flex that uses an embedded SQLite database. The data in the database contains quotes and other special characters which are escaped using a backslash or '\'. Before I retrieve the data and render it in a Flex text area control I want to remove the '\'. Is there any function in Flex which can help me d...

Inexplicable EXC_BAD_ACCESS in the iPhone simulator

I'm trying to build a class for handling all sqlite3 work and I've encountered an EXC_BAD_ACCESS which I just can't explain. I am new to Objective-C development and memory management in general so I apologize if this is a stupid question. When initializing the class I get the path to the database file and keep it around: NSArray * docu...

How to tell if Python SQLite database connection or cursor is closed?

Let's say that you have the following code: import sqlite3 conn = sqlite3.connect('mydb') cur = conn.cursor() # some database actions cur.close() conn.close() # more code below If I try to use the conn or cur objects later on, how could I tell that they are closed? I cannot find a .isclosed() method or anything like it. ...

C# SQLite SubSonic: Unable to open database in Windows Service

Are there any issues with using SQLite and SubSonic in a windows service. (have only tested on Vista) edit: I have a windows application and windiows service that needs to run on the same database. The windows app works fine (after adjusting the connection string and compiling the SubSonic Core with the updates mentioned here http://ww...

What's the easiest way to use SQLite with SAS?

I want to investigate how to access SQLite DB from SAS. What's the easiest way of doing this? Is there a SAS product that we can license to do that? I don't want to use ODBC drivers as that seems to have been written a long time ago and is not officially part of SQLite. ...