private void CreateConnectionByType()
        {
            try
            {
                switch (Type)
                {
                case ConnectionTypes.MSAccess:
                    ConnectionDescriptor = new MSAccessConnectionDescriptor();
                    return;

                case ConnectionTypes.MSSQL:
                    ConnectionDescriptor = new MSSQLConnectionDescriptor();
                    return;

                case ConnectionTypes.MSSQLAzure:
                    ConnectionDescriptor = new MSSQLAzureConnectionDescriptor();
                    return;

                case ConnectionTypes.MySQL:
                    ConnectionDescriptor = new MySQLConnectionDescriptor();
                    return;

                case ConnectionTypes.Oracle:
                    ConnectionDescriptor = new OracleNativeConnectionDescriptor();
                    return;

                case ConnectionTypes.PostgreSQL:
                    ConnectionDescriptor = new PostgreSQLConnectionDescriptor();
                    return;

                case ConnectionTypes.ODBC:
                    ConnectionDescriptor = new ODBCConnectionDescriptor();
                    return;

                case ConnectionTypes.OLEDB:
                    ConnectionDescriptor = new OLEDBConnectionDescriptor();
                    return;

                case ConnectionTypes.Firebird:
                    ConnectionDescriptor = new FirebirdConnectionDescriptor();
                    return;

                case ConnectionTypes.SQLite:
                    ConnectionDescriptor = new SQLiteConnectionDescriptor();
                    return;

                case ConnectionTypes.Excel:
                    ConnectionDescriptor = new ExcelConnectionDescriptor();
                    return;
                }
            }
            finally
            {
                //ignore
            }
        }
 public App()
 {
     // register metadata providers
     MSSQLConnectionDescriptor.Register();
     ODBCConnectionDescriptor.Register();
     OLEDBConnectionDescriptor.Register();
     MySQLConnectionDescriptor.Register();
     FirebirdConnectionDescriptor.Register();
     SybaseConnectionDescriptor.Register();
     PostgreSQLConnectionDescriptor.Register();
 }
Esempio n. 3
0
 static void Main()
 {
     MSSQLConnectionDescriptor.Register();
     ODBCConnectionDescriptor.Register();
     OLEDBConnectionDescriptor.Register();
     OracleNativeConnectionDescriptor.Register();
     MySQLConnectionDescriptor.Register();
     FirebirdConnectionDescriptor.Register();
     SybaseConnectionDescriptor.Register();
     PostgreSQLConnectionDescriptor.Register();
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     Application.Run(new MetadataEditor());
 }
        private void CreateConnectionByType()
        {
            try
            {
                switch (Type)
                {
                case ConnectionTypes.MSAccess:
                    ConnectionDescriptor = new MSAccessConnectionDescriptor();
                    return;

                case ConnectionTypes.MSSQL:
                    ConnectionDescriptor = new MSSQLConnectionDescriptor();
                    return;

                case ConnectionTypes.MSSQLAzure:
                    ConnectionDescriptor = new MSSQLAzureConnectionDescriptor();
                    return;

                case ConnectionTypes.MySQL:
                    ConnectionDescriptor = new MySQLConnectionDescriptor();
                    return;

                case ConnectionTypes.OracleNative:
                    ConnectionDescriptor = new OracleNativeConnectionDescriptor();
                    return;

                case ConnectionTypes.PostgreSQL:
                    ConnectionDescriptor = new PostgreSQLConnectionDescriptor();
                    return;

                case ConnectionTypes.ODBC:
                    ConnectionDescriptor = new ODBCConnectionDescriptor();
                    return;

                case ConnectionTypes.OLEDB:
                    ConnectionDescriptor = new OLEDBConnectionDescriptor();
                    return;

                case ConnectionTypes.Firebird:
                    ConnectionDescriptor = new FirebirdConnectionDescriptor();
                    return;

                case ConnectionTypes.SQLite:
                    ConnectionDescriptor = new SQLiteConnectionDescriptor();
                    return;

                case ConnectionTypes.Excel:
                    ConnectionDescriptor = new ExcelConnectionDescriptor();
                    return;

                //case ConnectionTypes.VistaDB5:
                //ConnectionDescriptor = new VistaDB5ConnectionDescriptor();
                //break;
                case ConnectionTypes.DB2:
                    ConnectionDescriptor = new DB2ConnectionDescriptor();
                    break;

                //case ConnectionTypes.Advantage:
                //ConnectionDescriptor = new AdvantageConnectionDescriptor();
                //break;
                case ConnectionTypes.Sybase:
                    ConnectionDescriptor = new SybaseConnectionDescriptor();
                    break;

                case ConnectionTypes.Informix:
                    ConnectionDescriptor = new InformixConnectionDescriptor();
                    break;

                //case ConnectionTypes.MSSQLCE:
                //ConnectionDescriptor = new MSSQLCEConnectionDescriptor();
                // break;
                default:
                    throw new ArgumentOutOfRangeException();
                }
            }
            finally
            {
                //ignore
            }
        }
        private void CreateConnectionByType()
        {
            try
            {
                switch (Type)
                {
                case ConnectionTypes.MSAccess:
                    ConnectionDescriptor = new MSAccessConnectionDescriptor();
                    return;

                case ConnectionTypes.MSSQL:
                    ConnectionDescriptor = new MSSQLConnectionDescriptor();
                    return;

                case ConnectionTypes.MSSQLAzure:
                    ConnectionDescriptor = new MSSQLAzureConnectionDescriptor();
                    return;

                case ConnectionTypes.MySQL:
                    ConnectionDescriptor = new MySQLConnectionDescriptor();
                    return;

                case ConnectionTypes.OracleNative:
                    ConnectionDescriptor = new OracleNativeConnectionDescriptor();
                    return;

                case ConnectionTypes.PostgreSQL:
                    ConnectionDescriptor = new PostgreSQLConnectionDescriptor();
                    return;

                case ConnectionTypes.ODBC:
                    ConnectionDescriptor = new ODBCConnectionDescriptor();
                    return;

                case ConnectionTypes.OLEDB:
                    ConnectionDescriptor = new OLEDBConnectionDescriptor();
                    return;

                case ConnectionTypes.Firebird:
                    ConnectionDescriptor = new FirebirdConnectionDescriptor();
                    return;

                case ConnectionTypes.SQLite:
                    ConnectionDescriptor = new SQLiteConnectionDescriptor();
                    return;

                case ConnectionTypes.Excel:
                    ConnectionDescriptor = new ExcelConnectionDescriptor();
                    return;

                case ConnectionTypes.DB2:
                    ConnectionDescriptor = new DB2ConnectionDescriptor();
                    break;

                case ConnectionTypes.Sybase:
                    ConnectionDescriptor = new SybaseConnectionDescriptor();
                    break;

                case ConnectionTypes.Informix:
                    ConnectionDescriptor = new InformixConnectionDescriptor();
                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }
            }
            catch
            {
            }
        }