Ejemplo n.º 1
0
        GetDbConnectionTypeNames()
        {
            DbConnectionTypeStringDictionary result =
                new DbConnectionTypeStringDictionary();

            result.Add(DbConnectionType.None,
                       typeof(object).AssemblyQualifiedName);

            result.Add(DbConnectionType.Odbc,
                       typeof(OdbcConnection).AssemblyQualifiedName);

            result.Add(DbConnectionType.OleDb,
                       typeof(OleDbConnection).AssemblyQualifiedName);

            result.Add(DbConnectionType.Sql,
                       typeof(SqlConnection).AssemblyQualifiedName);

            return(result);
        }
Ejemplo n.º 2
0
        GetOtherDbConnectionTypeNames(bool full, bool copy)
        {
            lock (syncRoot)
            {
                //
                // NOTE: One-time initialization, these are not per-interpreter
                //       datums and never change.
                //
                if (DbConnectionTypeFullNames == null)
                {
                    DbConnectionTypeFullNames =
                        new DbConnectionTypeStringDictionary();

                    //
                    // NOTE: This type name is optional because it requires the
                    //       System.Data.OracleClient assembly to be loaded.
                    //
                    DbConnectionTypeFullNames.Add(DbConnectionType.Oracle,
                                                  "System.Data.OracleClient.OracleConnection, " +
                                                  "System.Data.OracleClient, Version=2.0.0.0, " +
                                                  "Culture=neutral, PublicKeyToken=b77a5c561934e089");

                    //
                    // NOTE: This type name is optional because it requires the
                    //       .NET Framework v3.5 (SP1 or higher?) to be installed.
                    //
                    DbConnectionTypeFullNames.Add(DbConnectionType.SqlCe,
                                                  "System.Data.SqlServerCe.SqlCeConnection, " +
                                                  "System.Data.SqlServerCe, Version=3.5.1.0, " +
                                                  "Culture=neutral, PublicKeyToken=89845dcd8080cc91");

                    //
                    // NOTE: This type name is optional because it requires
                    //       the System.Data.SQLite assembly to be loaded
                    //       (i.e. from "https://system.data.sqlite.org/" OR
                    //       "https://sf.net/projects/sqlite-dotnet2/").
                    //
                    DbConnectionTypeFullNames.Add(DbConnectionType.SQLite,
                                                  "System.Data.SQLite.SQLiteConnection, " +
                                                  "System.Data.SQLite, Version=1.0, " +
                                                  "Culture=neutral, PublicKeyToken=db937bc2d44ff139");
                }

                if (DbConnectionTypeNames == null)
                {
                    DbConnectionTypeNames =
                        new DbConnectionTypeStringDictionary();

                    //
                    // NOTE: This type name is optional because it requires
                    //       the System.Data.SQLite assembly to be loaded
                    //       (i.e. from "https://system.data.sqlite.org/" OR
                    //       "https://sf.net/projects/sqlite-dotnet2/").
                    //
                    DbConnectionTypeNames.Add(DbConnectionType.SQLite,
                                              "System.Data.SQLite.SQLiteConnection");
                }

                if (copy)
                {
                    return(new DbConnectionTypeStringDictionary(full ?
                                                                DbConnectionTypeFullNames : DbConnectionTypeNames));
                }
                else
                {
                    return(full ?
                           DbConnectionTypeFullNames : DbConnectionTypeNames);
                }
            }
        }