You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@LeifUK I agree with @iadaz, but can you tell us what error you're getting?
Also, you can wrap your Insert() statement in a try..catch block in order to trap the exception, and in the catch you can examine _database.LastCommand to see what SQL was executed. This will help identify what the problem is.
If I had to guess, I'd say that your POCO class defines Name as the primary key but doesn't specify AutoIncrement=false. This makes PetaPoco think that the value for Name will be generated by the database, so it doesn't include that field in the SQL qhen you do Insert().
I am using PetaPoco.NetCore.
The following does not work:
_database is an instance of PetaPoco.NetCore.Database. The table is created as follows:
I have to do this instead:
This works fine with the .Net version of PetaPoco.
The text was updated successfully, but these errors were encountered: