コード例 #1
0
        public static DatabaseModel.Columns CreateTestTable(string createTableStatement, ConnectionType connectionType)
        {
            try
            {
                RemoveTestTable(connectionType);
            }
            catch { }

            try
            {
                DatabaseHelpers.ExecuteSqlStatement(createTableStatement, connectionType);

                DatabaseAssistant databaseAssistant = DatabaseAssistant.GetDatabaseAssistant(connectionType);
                using (var connection = databaseAssistant.CreateConnection(DatabaseHelpers.GetDefaultConnectionString(connectionType)))
                {
                    connection.Open();
                    return(new DatabaseModel.Columns(databaseAssistant.GetTableColumns(connection, "TESTTABLE")));
                }
            }
            catch
            {
                try
                {
                    RemoveTestTable(connectionType);
                }
                catch { }
                throw;
            }
        }
コード例 #2
0
        public static DatabaseModel.ProcedureParameters CreateTestProc(string createProcedureStatement, ConnectionType connectionType)
        {
            try
            {
                RemoveTestProc(connectionType);
            }
            catch { }

            try
            {
                DatabaseHelpers.ExecuteSqlStatement(createProcedureStatement, connectionType);

                DatabaseAssistant databaseAssistant = DatabaseAssistant.GetDatabaseAssistant(connectionType);
                using (var connection = databaseAssistant.CreateConnection(DatabaseHelpers.GetDefaultConnectionString(connectionType)))
                {
                    connection.Open();
                    return(new DatabaseModel.ProcedureParameters(databaseAssistant.GetStoredProcedureParameters(connection, "Test Proc")));
                }
            }
            catch
            {
                try
                {
                    RemoveTestProc(connectionType);
                }
                catch { }
                throw;
            }
        }
コード例 #3
0
        internal static void CreateTestFunction(string createFunctionStatement, ConnectionType connectionType)
        {
            try
            {
                RemoveTestFunction(connectionType);
            }
            catch { }

            try
            {
                DatabaseHelpers.ExecuteSqlStatement(createFunctionStatement, connectionType);
            }
            catch
            {
                try
                {
                    RemoveTestFunction(connectionType);
                }
                catch { }
                throw;
            }
        }
コード例 #4
0
 public static void RemoveTestTable(ConnectionType connectionType)
 {
     DatabaseHelpers.ExecuteSqlStatement(@"DROP TABLE TESTTABLE", connectionType);
 }
コード例 #5
0
 internal static void RemoveTestFunction(ConnectionType connectionType)
 {
     DatabaseHelpers.ExecuteSqlStatement("DROP Function TestFunction", connectionType);
 }
コード例 #6
0
 public static void RemoveTestProc(ConnectionType connectionType)
 {
     DatabaseHelpers.ExecuteSqlStatement("DROP PROCEDURE \"Test Proc\"", connectionType);
 }