public void updateHistory(familyHistory history) { string connectionString = @"Data Source=cdb.c1lbyzt9l8fn.us-west-2.rds.amazonaws.com,1433;" + "Initial Catalog=cis;" + "User id=sonaaaa;" + "Password=mo7senzzzz;"; SqlConnection myConnection = new SqlConnection(connectionString); myConnection.Open(); SqlCommand myCommand = new SqlCommand(); myCommand.CommandText = "UPDATE familyHistory SET relative ='" + history.getRelative() + "',disease ='" + history.getDisease() + "' WHERE id = " + history.getID() + ";"; myCommand.Connection = myConnection; myCommand.ExecuteNonQuery(); myConnection.Close(); }
public void insertHistory(familyHistory history) { string connectionString = @"Data Source=cdb.c1lbyzt9l8fn.us-west-2.rds.amazonaws.com,1433;" + "Initial Catalog=cis;" + "User id=sonaaaa;" + "Password=mo7senzzzz;"; SqlConnection myConnection = new SqlConnection(connectionString); myConnection.Open(); SqlCommand myCommand = new SqlCommand(); myCommand.CommandText = "insert into familyHistory (relative,disease) Values ('" + history.getRelative() + "','" + history.getDisease() + "') ; "; myCommand.Connection = myConnection; myCommand.ExecuteNonQuery(); myConnection.Close(); }