/// <summary> /// Temporary /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnColumns_Click(object sender, EventArgs e) { IDataProvider provider = DbUtilities.GetDataProvider(this.txtFilename.Text); if (provider != null) { DbConnection connection = provider.CreateConnection(this.txtFilename.Text); connection.Open(); try { System.Diagnostics.Debug.Print("List of tables:"); List <string> list = DbUtilities.GetTablesByField(connection, "Geometry", "blob"); foreach (string s in list) { System.Diagnostics.Debug.Print(s); } //if (listView1.SelectedIndices.Count > 0) //{ // bool exists = DbUtilities.ColumnExists(connection, listView1.SelectedItems[0].Text, "Geometry"); // MessageBox.Show("Geometry field exists: " + exists.ToString()); //} } finally { connection.Close(); } } }
/// <summary> /// Returns the list of tables which hold geometry /// </summary> /// <returns>List of table names</returns> public List <string> GetSpatialTables() { this.CheckConnection(); return(DbUtilities.GetTablesByField(m_connection, "Geometry", "blob")); }