string themeQuery = "SELECT * FROM Theme";
using (SQLiteCommand command = new SQLiteCommand(themeQuery, externalConnection))
using (SQLiteDataReader reader = command.ExecuteReader())
{
while (reader.Read())
{
int oldThematicId = Convert.ToInt32(reader["ThematicId"]);
int newThematicId = thematicMapping[oldThematicId];
string name = reader["Name"].ToString();
InsertTheme(newThematicId, name);
int newId = GetLastInsertId();
themeMapping[Convert.ToInt32(reader["Id"])] = newId;
}
}
string questionQuery = "SELECT * FROM Question";
using (SQLiteCommand command = new SQLiteCommand(questionQuery, externalConnection))
using (SQLiteDataReader reader = command.ExecuteReader())
{
while (reader.Read())
{
int oldThemeId = Convert.ToInt32(reader["ThemeId"]);
int newThemeId = themeMapping[oldThemeId];
string text = reader["Text"].ToString();
InsertQuestion(newThemeId, text);
int newId = GetLastInsertId();
questionMapping[Convert.ToInt32(reader["Id"])] = newId;
}
}