I’m trying to make SQLite works on a FEZ Spider flashed with .Net MF 4.2
But I am getting an exception.
I can read and write text files on the SD Card with no problems.
I made a new .Net gadgeteer 4.2 project, used the Fez EMX Spider board, and an SDCard connected to socket F.
Here is the code I tried to run (taken from the GHI 4.2 API reference)
try
{
// Format the media if it was not.
VolumeInfo nand = new VolumeInfo("SD");
if (!nand.IsFormatted)
{
nand.Format("FAT", 0);
}
// Create new database file
Database myDatabase = new Database();
// Open a new Database in NAND Flash
myDatabase.Open("\\SD\\myDatabase.dbs");
//add a table
myDatabase.ExecuteNonQuery("CREATE Table Temperature (Room TEXT, Time INTEGER, Value DOUBLE)");
}
catch (Exception e)
{
Debug.Print(e.Message);
Debug.Print(Database.GetLastError());
}
-The VolumeInfo part works
-The exception happens at myDatabase.ExecuteNonQuery(“CREATE Table Temperature (Room TEXT, Time INTEGER, Value DOUBLE)”);
-Exception:
Exception GHI.Premium.SQLite.SQLiteException - 0x00000000 (1)
Message: Could not execute SQL statement.
GHI.Premium.SQLite.Database::ExecuteNonQuery [IP: 0022]
AMD_EMX_SPIDER_0.Program::Main [IP: 0015]
I think SQLite is supposed to work with EMX right ?