Пример #1
0
        public static void updateTaskInfoDataGridView(DataGridView taskInfoDataGridView)
        {
            MySqlConnection conn = null;

            try
            {
                DataTable dt = (DataTable)taskInfoDataGridView.DataSource;
                if (dt != null)
                {
                    dt.Rows.Clear();
                    taskInfoDataGridView.DataSource = dt;
                }
                conn = DatabaseOpt.getDBConnection();
                taskInfoDataGridView.DataSource = DatabaseOpt.queryAll(conn);
                taskInfoDataGridView.Refresh();
            }
            finally
            {
                DatabaseOpt.close(conn);
            }
        }