Пример #1
0
        private void InitStructPage()
        {
            try
            {
                WantStructure();
                chbCopyStructure.Enabled = m_target.WriterCaps.AllowDataOnly;
                if (m_chooseNode == null)
                {
                    m_chooseNode    = new DbDefChooseTreeNode(m_structure);
                    treObjects.Root = m_chooseNode;
                }
                if (m_target.WriterCaps.MultipleSchema)
                {
                    // originalni schemata muzeme udrzet jen v pripade, ze nejaka existuji
                    rbOriginalSchema.Enabled = m_chooseNode.m_db.Schemata.Count > 0;

                    if (m_target.WriterCaps.HasStructure)
                    {
                        rbExplicitSchema.Enabled = true;
                        cbxExplicitSchema.Items.Clear();
                        m_target.OpenConnection();
                        foreach (var name in StructLoader.SchemaNames(mem2 => m_target.InvokeLoadStructure(mem2, null)))
                        {
                            cbxExplicitSchema.Items.Add(name);
                        }
                        if (cbxExplicitSchema.Items.Count > 0)
                        {
                            cbxExplicitSchema.SelectedIndex = 0;
                        }
                    }
                    else
                    {
                        rbExplicitSchema.Enabled = false;
                    }
                }
                else
                {
                    rbExplicitSchema.Enabled = rbOriginalSchema.Enabled = false;
                }
                if (!rbOriginalSchema.Enabled && rbOriginalSchema.Checked)
                {
                    rbDefaultSchema.Checked = true;
                }
                if (!rbExplicitSchema.Enabled && rbExplicitSchema.Checked)
                {
                    rbDefaultSchema.Checked = true;
                }
                cbxExplicitSchema.Enabled = rbExplicitSchema.Checked;
            }
            catch (Exception err)
            {
                Errors.Report(err);
                wizard1.Back();
            }
        }
Пример #2
0
        public void ChangeSchema()
        {
            var    schemata  = StructLoader.SchemaNames(dbmem => TableSource.Database.InvokeLoadStructure(dbmem, null));
            string newschema = InputBox.Run("s_new_schema", TableSource.FullName.Schema, schemata);

            if (newschema != null)
            {
                TableSource.ChangeSchema(newschema);
                CallCompleteChanged();
            }
        }
Пример #3
0
        public void ChangeSchema()
        {
            var    schemata  = StructLoader.SchemaNames(dbmem => m_conn.InvokeLoadStructure(dbmem, null));
            string newschema = InputBox.Run("s_new_schema", m_domain.FullName.Schema, schemata);

            if (newschema != null)
            {
                m_conn.ChangeObjectSchema(m_domain, newschema);
                Parent.CompleteRefresh();
            }
        }
Пример #4
0
        public void ChangeSchema()
        {
            var    dbconn    = this.FindDatabaseConnection(ConnPack);
            var    schemata  = StructLoader.SchemaNames(dbmem => dbconn.InvokeLoadStructure(dbmem, null));
            string newschema = InputBox.Run("s_new_schema", DbObjectName.Schema, schemata);

            if (newschema != null)
            {
                ISpecificObjectStructure so = LoadStructure();
                dbconn.ChangeObjectSchema(so, newschema);
                //m_conn.RunScript(dmp => { dmp.ChangeSpecificObjectSchema(so, newschema); });
                CallCompleteChanged();
            }
        }
Пример #5
0
 //public static List<string> InvokeLoadColumnNames(this IPhysicalConnection conn, string dbname, NameWithSchema table)
 //{
 //    DatabaseStructureMembers dbmem = new DatabaseStructureMembers
 //    {
 //        TableFilter = new List<NameWithSchema>{table},
 //        TableMembers = TableStructureMembers.ColumnNames,
 //    };
 //    IDatabaseStructure dbs = conn.InvokeLoadStructure(dbname, dbmem);
 //    return new List<string>(from c in dbs.Tables[table].Columns select c.ColumnName);
 //}
 public static List <string> InvokeLoadSchemaNames(this IPhysicalConnection conn, string dbname)
 {
     return(StructLoader.SchemaNames(dbmem => conn.InvokeLoadStructure(dbname, dbmem, null)));
 }