Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Unable to create a new database with CF

2006-09-04
2013-04-15
  • Hi, I'm trying to create a new DB file on a PocketPC using the CF version of the sqlite .Net library. The code is as follows:

    SQLiteConnection sc = new SQLiteConnection(@"Data Source="+MJ.GetInstance().GetName()+".db;Version=3;New=True;Compress=True;");;
            sc.Open();
            SQLiteCommand sqlite_cmd = sc.CreateCommand();
            sqlite_cmd.CommandText = "CREATE TABLE PackEntries (ID INTEGER PRIMARY KEY, EntryDate TEXT, PackNumber TEXT, PartNumber TEXT, Qty NUMERIC, SGrn TEXT, UserID TEXT)";
            sqlite_cmd.ExecuteNonQuery();
            sqlite_cmd.Dispose();
            sc.Close();

    The result is that the file is created (it didn't exist before), but it's size remains at 0 bytes, as no data is entered.

    Any idea what I'm doing wrong?
    Thanks,

    Rich

     
    • Hi, I have the same problem. The file created is always 0 byte in size.

      Please help!

      TIA
      Achim