示例#1
0
 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);
 }
示例#2
0
 /// <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);
     }
 }