public List <string[]> SelectNeuroNetDefinitions() { List <string[]> defs = new List <string[]>(); connector.ConnectToDB(); SQLiteCommand cmd = new SQLiteCommand(connector.connection); cmd.CommandText = "SELECT NeuroNet.Name, TopologyTypeName, TASK.NAME, NeuronCount, " + "LayerCount, ActivateFunctionType " + "FROM NeuroNet,TASK WHERE NeuroNet.TaskID = TASK.ID"; try { SQLiteDataReader reader = cmd.ExecuteReader(); while (reader.Read()) { string[] line = new string[6]; for (int i = 0; i < 6; i++) { line[i] = reader[i].ToString(); } line[1] = LibraryOfTopologies.GetTopologyName(line[1]); line[5] = LibraryOfActivateFunctions.GetActivateFunctionName(line[5]); defs.Add(line); } reader.Close(); } catch (SQLiteException ex) { MessageBox.Show(ex.Message); } connector.DisconnectFromDB(); return(defs); }
public string[] SelectNeuroNetDefinitionByName(string name) { connector.ConnectToDB(); SQLiteCommand cmd = new SQLiteCommand(connector.connection); cmd.CommandText = "SELECT NeuroNet.Name, TopologyTypeName, TASK.NAME, NeuronCount, " + "LayerCount, NeuronsInLayer, ActivateFunctionType, AFParameters " + "FROM NeuroNet,TASK WHERE NeuroNet.TaskID = TASK.ID AND NeuroNet.Name ='" + name + "'"; string[] line = new string[8]; try { SQLiteDataReader reader = cmd.ExecuteReader(); while (reader.Read()) { for (int i = 0; i < 8; i++) { line[i] = reader[i].ToString(); } } line[1] = LibraryOfTopologies.GetTopologyName(line[1]); line[6] = LibraryOfActivateFunctions.GetActivateFunctionName(line[6]); reader.Close(); } catch (SQLiteException ex) { MessageBox.Show(ex.Message); } connector.DisconnectFromDB(); return(line); }