Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

Sqlirte Constraint exception in WPF

$
0
0

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);
            }


Viewing all articles
Browse latest Browse all 12583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>