locked
Sqlirte Constraint exception in WPF RRS feed

  • Question

  • When i try to store data in my Sqlite database i get a constraint exception. That's all it tell me.

    This is my code"

       try
                {
    
               
                    using (var db = new SQLite.SQLiteConnection(dbpath))
                    {
    
    
    
                        // Create the tables if they don't exist 
                        db.Insert(new storingCredentailsDb()
                        {
                            Name = this.name,
                            Age = this.Age,
                            picUrl = this.picUrl,
                            gender = this.gender,
                            Password = this.password,
                            Handle = this.Handle,
                            RawPicUrl = this.rawPicUr
    
    
                        }
                        );
    
    
                        Console.WriteLine("Data was stored");
    
                        db.Commit();
                        db.Dispose();
                        db.Close();
    
                    }
    
    
    
                }
                catch (SQLiteException f)
                {
                    Console.WriteLine("Data was not stored: "+f.Message);
                }

    • Moved by Marvin_Guo Tuesday, February 11, 2014 5:34 AM
    Monday, February 3, 2014 3:02 AM

Answers

  • Your problem is not for this forum, neither it is for WPF, neither it is for C# in fact it is not a problem for a Microsoft forum.

    Use Google and search for SQLite. Be aware Microsoft has 2 cheaper products.


    Success
    Cor

    • Proposed as answer by Marvin_Guo Tuesday, February 4, 2014 3:08 AM
    • Marked as answer by Just Karl Tuesday, February 11, 2014 11:34 PM
    Monday, February 3, 2014 11:11 AM