Пример #1
0
        /// <summary>
        /// Helper function for testing the shapefile importer
        /// </summary>
        /// <param name="filename"></param>
        /// <param name="tableName"></param>
        /// <returns></returns>
        public static bool OpenShapefile(string filename, string tableName)
        {
            string databaseFileName = Path.Combine(Path.GetDirectoryName(filename), "shape.dat");
            var    client           = new SqliteDataClient(databaseFileName);

            using (DbConnection conn = client.GetConnection())
            {
                return(ShapefileHelper.ImportShapefile(conn, client, filename, tableName, -1));
            }
        }
Пример #2
0
        /// <summary>
        /// Helper function for checking structure of existing Db
        /// </summary>
        /// <param name="client"></param>
        /// <returns></returns>
        public static DataTable GetSchema(SqliteDataClient client)
        {
            if (client == null)
            {
                return(null);
            }

            using (DbConnection conn = client.GetConnection())
            {
                //var dt = conn.GetSchema();
                return(conn.GetSchema("Tables"));
            }
        }
Пример #3
0
        /// <summary>
        /// Helper function for testing the shapefile importer
        /// </summary>
        /// <param name="filename"></param>
        /// <param name="tableName"></param>
        /// <returns></returns>
        public static bool OpenShapefile(string filename, string tableName)
        {
            string databaseFileName = Path.Combine(Path.GetDirectoryName(filename), "shape.dat");
            var client = new SqliteDataClient(databaseFileName);

            using (DbConnection conn = client.GetConnection())
            {
                return ShapefileHelper.ImportShapefile(conn, client, filename, tableName, -1);
            }
        }
Пример #4
0
        /// <summary>
        /// Helper function for checking structure of existing Db
        /// </summary>
        /// <param name="client"></param>
        /// <returns></returns>
        public static DataTable GetSchema(SqliteDataClient client)
        {
            if (client == null)
                return null;

            using (DbConnection conn = client.GetConnection())
            {
                //var dt = conn.GetSchema();
                return conn.GetSchema("Tables");
            }
        }