From 705a3892c1531872231a0c275320ad3d96232d74 Mon Sep 17 00:00:00 2001 From: kougyokugentou <41278462+kougyokugentou@users.noreply.github.com> Date: Mon, 11 May 2020 14:56:02 -0700 Subject: [PATCH] Update query regarding updating students. --- SqliteDataAccess.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/SqliteDataAccess.cs b/SqliteDataAccess.cs index d8b19cf..6f450b7 100644 --- a/SqliteDataAccess.cs +++ b/SqliteDataAccess.cs @@ -97,8 +97,9 @@ namespace DBWizard { using (IDbConnection cnn = new SQLiteConnection(LoadConnectionString())) { - string strQuery = "UPDATE Students SET student_id = @student_id, FirstName = @First_Name, LastName = @Last_Name," + - "DOB = @_dob, Gender = @_gender, Address = @_address, GradeLevel = @Grade_Level, Photo = @_photo " + + string strQuery = "UPDATE Students SET student_id = @student_id, FirstName = @First_Name, " + + "LastName = @Last_Name, DOB = @_dob, Gender = @_gender, Address = @_address, program_id=@_program_id, " + + "school_id=@_school_id, GradeLevel = @Grade_Level, Photo = @_photo " + "WHERE id = @_id;"; cnn.Execute(strQuery, new @@ -110,6 +111,8 @@ namespace DBWizard _dob = stu.DOB, _gender = stu.gender, _address = stu.address, + _program_id = stu.program_id, + _school_id = stu.school_id, Grade_Level = stu.GradeLevel, _photo = stu.photo ?? null });