Exemple #1
0
        public static MapProvider QueryMapProvider(string ProviderName)
        {
            MapProvider mapProvider = null;

            SqliteConnection conn    = OpenDatabase();
            SqliteCommand    command = conn.CreateCommand();

            command.CommandText = $"Select TmapProviders.mapProviderID, TmapProviders.mapProviderName,TMapProvidersURLS.mapProviderURL AS 'baseURL',TMapProvidersURLParts.mapProviderURLPartType, group_concat(TMapProvidersURLParts.mapProviderURLPartURL,'###') AS 'urlParts',TmapProviderAccessTypes.mapProviderAccessType AS 'type' " +
                                  $"From TmapProviders, TMapProvidersURLS, TmapProvidersURLParts, TmapProviderAccessTypes " +
                                  $"Where TmapProviders.mapProviderName = '{ProviderName}' and TmapProviders.mapProviderID = TmapProvidersURLS.mapProviderID and TmapProviders.mapProviderID = TMapProvidersURLParts.mapProviderID and TmapProviders.mapProviderID = TmapProviderAccessTypes.mapProviderID;";
            using (SqliteDataReader reader = command.ExecuteReader())
            {
                if (reader.Read())
                {
                    mapProvider = MapProvider.FromDataRow(reader);
                }
            }
            conn.Close();
            return(mapProvider);
        }