예제 #1
0
        private void LoadConnectionDefinitionToForm(PFConnectionDefinition conndef)
        {
            try
            {
                this.ConnectionName   = conndef.ConnectionName;
                this.ConnectionString = conndef.ConnectionString;
                PFKeyValueList <string, string> dbPlatformProperties = conndef.DbPlatformConnectionStringProperties;
                //stKeyValuePair<string, string> keyval = default(stKeyValuePair<string, string>);

                this.txtDsnName.Text    = dbPlatformProperties.Find("Dsn").Value;
                this.txtDriverName.Text = dbPlatformProperties.Find("Driver").Value;

                SaveFormFields();
            }
            catch (System.Exception ex)
            {
                _msg.Length = 0;
                _msg.Append("Error occurred loading saved connection definition. External XML file format may contain errors. ErrorMessage: \r\n");
                _msg.Append(AppGlobals.AppMessages.FormatErrorMessage(ex));
                AppMessages.DisplayErrorMessage(_msg.ToString());
            }
            finally
            {
                ;
            }
        }
        private void LoadConnectionDefinitionToForm(PFConnectionDefinition conndef)
        {
            try
            {
                this.ConnectionName   = conndef.ConnectionName;
                this.ConnectionString = conndef.ConnectionString;
                PFKeyValueList <string, string> dbPlatformProperties = conndef.DbPlatformConnectionStringProperties;

                this.txtDataSource.Text = dbPlatformProperties.Find("DataSource").Value;
                this.txtUserId.Text     = dbPlatformProperties.Find("Username").Value;
                this.txtPassword.Text   = dbPlatformProperties.Find("Password").Value;
                this.chkUseIntegratedSecurity.Checked = PFTextProcessor.ConvertStringToBoolean(dbPlatformProperties.Find("UseIntegratedSecurity").Value, "false");

                SaveFormFields();
            }
            catch (System.Exception ex)
            {
                _msg.Length = 0;
                _msg.Append("Error occurred loading saved connection definition. External XML file format may contain errors. ErrorMessage: \r\n");
                _msg.Append(AppGlobals.AppMessages.FormatErrorMessage(ex));
                AppMessages.DisplayErrorMessage(_msg.ToString());
            }
            finally
            {
                ;
            }
        }