Beispiel #1
0
        public static void SelectAllData()
        {
            DbList db = new DbList();

            string select = "SELECT * FROM weapons.faces";

            string connetionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;

            MySqlConnection conn = new MySqlConnection(connetionString);

            conn.Open();
            MySqlCommand     cmd     = new MySqlCommand(select, conn);
            MySqlDataAdapter adapter = new MySqlDataAdapter(cmd);

            try
            {
                cmd.ExecuteNonQuery();
                DataTable dt = new DataTable();
                adapter.Fill(dt);
                db.allinfo_dg.ItemsSource = dt.DefaultView;
                adapter.Update(dt);
            }
            catch (Exception ex) { MessageBox.Show(ex.Message); }
            conn.Close();
        }
Beispiel #2
0
        private void OpenDatabaseList_Click(object sender, RoutedEventArgs e)
        {
            DbList l = new DbList();

            l.Show();
        }