public void addEmptyList(string title) { MySqlConnection myConnection = new MySqlConnection(); try { myConnection = new MySqlConnection(connectionString); myConnection.Open(); } catch { Console.WriteLine("ЖОПА!"); myConnection.Close(); Console.ReadKey(); return; } SendingList temp = new SendingList(title); temp.createNew(myConnection); }
/// <summary> /// Get all lists from base /// </summary> public SendingLists() { MySqlConnection myConnection = new MySqlConnection(); try { myConnection = new MySqlConnection(connectionString); myConnection.Open(); } catch { Console.WriteLine("ЖОПА!"); myConnection.Close(); Console.ReadKey(); return; } string strSQL = "SELECT title FROM " + TABLE_NAME; MySqlCommand command = new MySqlCommand(strSQL, myConnection); MySqlDataReader reader = command.ExecuteReader(); while (reader.Read()) { SendingList temp = new SendingList((string)reader[0]); //temp.GetFromDataBase(myConnection); lists.Add(temp); } }