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; } }
public StoredProcedureNodeViewModel(DatabaseAssistant assistant, IDbConnection connection, string procedureName, NodeViewModel parent) : base(procedureName, parent) { AllowDrag = true; var parameterNames = GetParameterNames(assistant.GetStoredProcedureParameters(connection, procedureName)); ConfigureParameters(procedureName, parameterNames); }