I am trying to get the sqlite to work and I am not have any success. I went to the forums to post my problem but I can find anything that will let me add a post. I get the following exception:
A first chance exception of type ‘System.InvalidOperationException’ occurred in GHI.Hardware.dll
On this line of code: canDatabase = new GHI.SQLite.Database(rootDirectory + “\InovarTestTracker.db”);
using System;
using System.IO;
using System.Collections;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Presentation;
using Microsoft.SPOT.Presentation.Controls;
using Microsoft.SPOT.Presentation.Media;
using Microsoft.SPOT.Presentation.Shapes;
using Microsoft.SPOT.Touch;
using Microsoft.SPOT.IO;
using Gadgeteer.Networking;
using GT = Gadgeteer;
using GTM = Gadgeteer.Modules;
using Gadgeteer.Modules.GHIElectronics;
using GHI.IO;
using GHI.IO.Storage;
using GHI.SQLite;
namespace GadgeteerApp1
{
public partial class Program
{
int lastLED = 0;
string rootDirectory;
ControllerAreaNetwork can;
Bitmap picture;
GT.Timer timer;
GHI.IO.Storage.SDCard sd_Card = new GHI.IO.Storage.SDCard();
GHI.SQLite.Database canDatabase;
void ProgramStarted()
{
Debug.Print("Program Started");
can = new ControllerAreaNetwork(ControllerAreaNetwork.Channel.One, ControllerAreaNetwork.Speed.Kbps500);
sd_Card.Mount(4000);
/*FileStream testFile = sdCard.StorageDevice.Open("\\SD\\TestSerial.txt", FileMode.Open, FileAccess.ReadWrite);
byte[] readbyte = new byte[100];
testFile.Read(readbyte, 0, 100);
int test = 0;*/
bool fs_ready = false;
RemovableMedia.Insert += (a, b) =>
{
fs_ready = true;
};
while (!fs_ready)
{
System.Threading.Thread.Sleep(50);
}
if (VolumeInfo.GetVolumes()[0].IsFormatted)
{
rootDirectory = VolumeInfo.GetVolumes()[0].RootDirectory;
string lookat = rootDirectory;
}
canDatabase = new GHI.SQLite.Database(rootDirectory +
“\InovarTestTracker.db”);
}
I am using a Cerberus