Ejemplo n.º 1
0
        public void SetContext(DataAccessType dataAccessType, string connectionString)
        {
            this.DataAccessType         = dataAccessType;
            gbConnectionProperties.Text = String.Format("{0} Connection Properties", dataAccessType);

            m_ConnectionStringBuilder = DataAccessFactory.GetConnectionStringBuilder(dataAccessType);
            try
            {
                m_ConnectionStringBuilder.ConnectionString = connectionString;
            }
            catch (Exception ex)
            {
                MessageBox.Show(String.Format("Unable to read connection string: {0}", ex.Message), "Connection String Builder", MessageBoxButtons.OK, MessageBoxIcon.Error);
                m_ConnectionStringBuilder.ConnectionString = String.Empty;
            }

            olvConnectionProperties.SetObjects(m_ConnectionStringBuilder.Keys);
            olvConnectionProperties.AutoResizeColumn(olvColumnPropertyName.Index, ColumnHeaderAutoResizeStyle.ColumnContent);
            zUpdateConnectionString();
        }