Bugfix: Correctly return the new parent id that was inserted to the db.
This commit is contained in:
parent
50f266bf4d
commit
3d3e1bb0c3
@ -103,9 +103,10 @@ namespace DBWizard
|
||||
using (IDbConnection cnn = new SQLiteConnection(LoadConnectionString()))
|
||||
{
|
||||
string strQuery = "INSERT INTO PARENTS (FirstName,LastName,PhoneNumber,EmailAddress)" +
|
||||
"VALUES (@FirstName,@LastName,@PhoneNumber,@EmailAddress);";
|
||||
var affectedRow = cnn.Execute(strQuery, par);
|
||||
return affectedRow;
|
||||
"VALUES (@FirstName,@LastName,@PhoneNumber,@EmailAddress);" +
|
||||
"SELECT MAX(parent_id) as parent_id from parents;";
|
||||
int parent_id_out = cnn.Query<int>(strQuery, par).Single();
|
||||
return parent_id_out;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user