13 Replies
this part
Can you share a full code repository?
ok
GitHub
GitHub - Silme94/project
Contribute to Silme94/project development by creating an account on GitHub.
@Silme94 order of operations:
* line 463:
connection.Open()
* line 476: InsertThematic()
, which both opens and closes connection
* line 477: attempts to use the connection that was closed inside of InsertThematic()
alr
also, the fact that you close the connection inside of
InsertThematic()
means that when you reopen it, the last_insert_rowid()
is no longer relevant. that valud is only valid for a single open session. closing the connection means that information is lost and can't be accessed by opening a new connection to the db.
you might update InsertThematic
to return an int
, and inside of InsertThematic()
, before closign the connection, do that GetLastInsertId()
it will work the same for
?
yeah, you have to do the same for
Theme
and Question
. because the principle of the connecitno closing is the same across all of themit still return me 0
works for me.