示例#1
0
        static public DataTable executeQuery(DatabaseName databaseName, String query)
        {
            DataTable       dataTable       = new DataTable();
            MySqlConnection mySqlConnection = new MySqlConnection(SQLData.ConnStr(databaseName.ToString()));

            mySqlConnection.Open();
            MySqlDataAdapter mySqlDataAdapter = new MySqlDataAdapter(query, mySqlConnection);

            mySqlDataAdapter.Fill(dataTable);
            mySqlConnection.Close();
            return(dataTable);
        }
示例#2
0
 private void LoginButton_Click(object sender, EventArgs e)
 {
     try
     {
         updateData();
         MySqlConnection mySqlConnection = new MySqlConnection(SQLData.ConnStr("net7"));
         mySqlConnection.Open();
         mySqlConnection.Close();
         this.Close();
     }
     catch (MySqlException e1)
     {
         MessageBox.Show("N7 Login Encoutered a problem: \n\nBegin Message:\n" + e1.Message);
     }
 }
示例#3
0
 /// <summary>
 ///   <para>Global form handler to catch the &lt;enter&gt; key and close the dialog</para>
 /// </summary>
 private void onEnterKey(object sender, System.Windows.Forms.KeyPressEventArgs e)
 {
     if (e.KeyChar.Equals('\r'))
     {
         try
         {
             updateData();
             MySqlConnection mySqlConnection = new MySqlConnection(SQLData.ConnStr("net7"));
             mySqlConnection.Open();
             mySqlConnection.Close();
             this.Close();
         }
         catch (MySqlException e1)
         {
             MessageBox.Show("N7 Login Encoutered a problem: \n\nBegin Message:\n" + e1.Message);
         }
     }
 }