Ejemplo n.º 1
0
        /// <summary>
        /// 显示表名列表
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnViewList_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrWhiteSpace(TxtConnection.Text))
            {
                ConnectionString = TxtConnection.Text;
            }
            ViewList.Items.Clear();
            SqlHelper helper = new SqlHelper(ConnectionString);

            var TableList = helper.GetTables();

            ViewList.View = View.List;
            ViewList.BeginUpdate();
            foreach (var table in TableList)
            {
                ListViewItem item = new ListViewItem();
                item.Text = table;
                ViewList.Items.Add(item);
            }
            ViewList.EndUpdate();
        }