Bonjour,
Désolé pour le post en anglais mais comme je n'ai pas eu de réponse pertinente sur StackOverflow je viens voir si quelqu'un a une idée du problème ici.
I use an ORM to manage my SQLite database in my C# project. This is it : https://github.com/praeclarum/sqlite-net
It's really hopefull but I can't use SELECT Query. When I run this :
1 | var transacts = db.Table<Transact>(); |
I get in return this exception : system.reflection.targetinvocationexception
on this line :
1 2 3 4 | public void SetValue(object obj, object val) { _prop.SetValue(obj, val, null); } |
The complete message is :
system.reflection.targetinvocationexception exception has been thrown by the target of an invocation
And I have my constructors :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | public Transact() : base() { Console.WriteLine("yo"); } public Transact(int subCategoryIdT, string descriptionT, DateTime dateT, double amountT, int ownerIdT) { db.CreateTable<Transact>(); SubCategoryId = subCategoryIdT; Description = descriptionT; Date = dateT; Amount = amountT; OwnerId = ownerIdT; db.Insert(this); Console.WriteLine("I'm here !! I'm " + description + "."); } |
Can you see where my mistakes are?
The content of the innerException :
1 2 3 4 5 6 7 | System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Exception: Busy at SQLite.SQLiteCommand.ExecuteNonQuery () [0x000c6] in /Users/gautier/Documents/Dev/csharp/bumget/bumget/SQLite.cs:2087 at SQLite.SQLiteConnection.Execute (System.String query, System.Object[] args) [0x00046] in /Users/gautier/Documents/Dev/csharp/bumget/bumget/SQLite.cs:627 at bumget.Transact.set_OwnerId (Int32 value) [0x0003a] in /Users/gautier/Documents/Dev/csharp/bumget/bumget/Transact.cs:49 at at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 --- End of inner exception stack trace --- |
Merci pour votre aide.
+0
-0