コード例 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="WikipediaParser"/> class.
        /// </summary>
        /// <param name="connectionString">The connection string.</param>
        public WikipediaParser(string connectionString)
        {
            if(connectionString == null
            || connectionString.Trim() == "") {
                throw new ArgumentNullException(
                    "connectionString",
                    "The connectionString parameter cannot be null."
                );
            }

            this._cfg = UdlParser.ParseConnectionString(connectionString);
            this._db = new DAL(this._cfg);
            this._dh = new DataHandler(connectionString);
            this._sh = new StaticHandler(connectionString);
        }
コード例 #2
0
        // ---------------------------------------------------
        // CONSTRUCTORS
        // ---------------------------------------------------
        /// <summary>
        /// Default Ctor
        /// </summary>
        /// <param name="connectionString"></param>
        /// <param name="filename">The filename including the path of the spreadsheet file.</param>
        /// <exception cref="ArgumentNullException">If the connectionString or filename parameter is null or empty.</exception>
        public OpenDocumentImporter(string connectionString, string filename)
        {
            if(connectionString == null
            || connectionString.Trim() == "") {
                throw new ArgumentNullException(
                    "connectionString",
                    "The connectionString parameter canot be null."
                );
            }

            if(filename == null
            || filename.Trim() == "") {
                throw new ArgumentNullException(
                    "filename",
                    "The filename parameter canot be null."
                );
            }

            this._filename = filename;

            this._cfg = UdlParser.ParseConnectionString(connectionString);
            this._db = new DAL(this._cfg);
            this._dh = new DataHandler(connectionString);
        }
コード例 #3
0
ファイル: MainForm.cs プロジェクト: vandango/MovieMatic
        /// <summary>
        /// Open the OptionDialog and try to connect to the database
        /// </summary>
        private void _OpenOptionDialogAndTryDBConnect()
        {
            OptionForm of = new OptionForm();

            if(of.ShowDialog(this) == DialogResult.OK) {
                this._db = null;

                try {
                    this._db = new DataHandler(
                        Configuration.ConnectionString
                    );
                    this._LoadData(FilterType.NoFilter);
                }
                catch(Exception ex) {
                    StringBuilder str = new StringBuilder();
                    str.Append("Fehler beim Aufbau einer Verbindung zur Datenbank!\n");

                    if(ex.Message != null) {
                        str.Append("Fehlerbeschreibung:\n" + ex.Message + "\n");
                    }

                    if(ex.InnerException != null) {
                        if(ex.InnerException.Message != null) {
                            str.Append("Weitergereichte Fehlerbeschreibung:\n");
                            str.Append(ex.InnerException.Message + "\n");
                        }
                    }

                    str.Append("\nWollen sie die Datenbank Einstellungen verändern?\n");

                    if(MessageBox.Show(
                        str.ToString(),
                        "MovieMatic ERROR",
                        MessageBoxButtons.YesNo,
                        MessageBoxIcon.Error) == DialogResult.Yes) {
                        this._OpenOptionDialogAndTryDBConnect();
                    }
                }
            }
            else {
                if(this._initial) {
                    MessageBox.Show(
                        "MovieMativ konnte nicht auf die Datenbank zugreifen und wird beendet!",
                        "MovieMatic ERROR"
                    );

                    this._close_app = true;
                }
            }
        }