已经封装好的函数,即可调用
1 #region 最新数据表信息显示事件 2 /// <summary> 3 /// 最新数据表信息显示事件 4 /// </summary> 5 /// <param name="sender"></param> 6 /// <param name="e"></param> 7 private void showNewSqliteInfo_Click(object sender, EventArgs e) 8 { 9 if (newDB) 10 { 11 connectionString = string.Format(@"Data Source={0};Version=3;", ndb_Path); 12 using (SQLiteConnection conn = new SQLiteConnection(connectionString)) 13 { 14 conn.Open(); 15 DataTable schemaTable = conn.GetSchema("TABLES"); 16 // 移除数据表中特定的列 17 schemaTable.Columns.Remove("TABLE_CATALOG"); 18 // 设定特定列的序号 19 schemaTable.Columns["TABLE_NAME"].SetOrdinal(1); 20 this.new_dataGridView1.DataSource = schemaTable; 21 newClickState = false; 22 } 23 } 24 else 25 { 26 MessageBox.Show("您未选择数据库!!!"); 27 } 28 } 29 #endregion