/// <summary>
        /// 读取oracle数据库所有表名
        /// </summary>
        private void bindListBox()
        {
            ListBox1.Items.Clear();
            string    sql = "Select table_name From user_tables";
            DataTable dt  = ora.ExecuteTable(sql);

            foreach (DataRow dr in dt.Rows)
            {
                ListBoxItem item = new ListBoxItem();
                item.Content = dr["TABLE_NAME"];
                ListBox1.Items.Add(item);
            }
        }
Example #2
0
        public SelectColumnCondition(string tablename, OracleHelper_Test ora)
        {
            InitializeComponent();
            this.tableName = tablename;
            string sql = string.Format("select column_name from user_tab_cols where table_name='{0}'", tablename);

            DataTable dtable = ora.ExecuteTable(sql);

            foreach (DataRow dr in dtable.Rows)
            {
                ListBoxItem item = new ListBoxItem();
                item.Content = dr["COLUMN_NAME"];
                item.Tag     = dr["COLUMN_NAME"];
                ListBox1.Items.Add(item);
            }
        }