void item_Click(object sender, EventArgs e)
        {
            try
            {
                string connectionString = Helper.FixConnectionString(this.Parent.Connection.ConnectionString, this.Parent.Connection.ConnectionTimeout);

                using (IRepository repository = new DBRepository(connectionString))
                {
                    using (RenameOptions ro = new RenameOptions(this.Parent.Name))
                    {
                        if (ro.ShowDialog() == DialogResult.OK && !string.IsNullOrEmpty(ro.NewName))
                        {
                            repository.RenameTable(this.Parent.Name, ro.NewName);
                            RefreshTree();
                        }
                    }
                }
            }

            catch (System.Data.SqlServerCe.SqlCeException sqlCe)
            {
                Connect.ShowErrors(sqlCe);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Пример #2
0
        void item_Click(object sender, EventArgs e)
        {
            try
            {
                string connectionString = Helper.FixConnectionString(this.Parent.Connection.ConnectionString, this.Parent.Connection.ConnectionTimeout);
                
                using (IRepository repository = new DBRepository(connectionString))
                {
                    using (RenameOptions ro = new RenameOptions(this.Parent.Name))
                    {
                        if (ro.ShowDialog() == DialogResult.OK && !string.IsNullOrEmpty(ro.NewName))
                        {
                            repository.RenameTable(this.Parent.Name, ro.NewName);
                            RefreshTree();
                        }
                    }
                }
            }

            catch (System.Data.SqlServerCe.SqlCeException sqlCe)
            {
                Connect.ShowErrors(sqlCe);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }