Пример #1
0
        /// <summary>
        /// 打开SQL Server数据库
        /// </summary>
        /// <param name="filePath"></param>
        private void SelectSQL(string filePath)
        {
            DBlink mylink = new DBlink();

            TableList = mylink.SQLconection(filePath);
            if (TableList == null)
            {
                MessageBox.Show("数据库打开失败", "操作提示");
            }
            else
            {
                cmbTableList.IsEnabled = true;
                txtDBPath.Text         = filePath;
                lblDBType.Content      = DBType;
                cmbTableList.Items.Clear();
                for (int i = 0; i < TableList.Length; i++)
                {
                    cmbTableList.Items.Add(TableList[i]);
                }

                cmbTableList.SelectedIndex = 0;

                MessageBox.Show("数据库打开成功", "操作提示");
            }
        }
        /// <summary>
        /// 打开SQL Server数据库
        /// </summary>
        /// <param name="filePath"></param>
        private void SelectSQL()
        {
            DBlink mylink = new DBlink();

            TableList = mylink.SQLconection(txtDBPath.Text);
            if (TableList == null)
            {
                MessageBox.Show("数据库打开失败", "操作提示");
            }
            else
            {
                dgvDB.ItemsSource = mylink.Read(TableName, DBType).DefaultView;
            }
        }
 /// <summary>
 /// 打开SQL Server数据库
 /// </summary>
 /// <param name="filePath"></param>
 private void SelectSQL()
 {
     DBlink mylink = new DBlink();
     TableList = mylink.SQLconection(txtDBPath.Text);
     if (TableList == null)
     {
         MessageBox.Show("数据库打开失败", "操作提示");
     }
     else
     {
         dgvDB.ItemsSource = mylink.Read(TableName, DBType).DefaultView;
        
     }
 }
Пример #4
0
        /// <summary>
        /// 打开SQL Server数据库
        /// </summary>
        /// <param name="filePath"></param>
        private void SelectSQL(string filePath)
        {
  
            DBlink mylink = new DBlink();
            TableList = mylink.SQLconection(filePath);
            if (TableList == null)
            {
                MessageBox.Show("数据库打开失败", "操作提示");
            }
            else
            {        
                cmbTableList.IsEnabled = true;
                txtDBPath.Text = filePath;
                lblDBType.Content = DBType;
                cmbTableList.Items.Clear();
                for (int i = 0; i < TableList.Length; i++)
                {
                    cmbTableList.Items.Add(TableList[i]);
                }

                cmbTableList.SelectedIndex = 0;

                MessageBox.Show("数据库打开成功", "操作提示");
            }
        }