We are trying to do the following on a Dynamic Form: Use SQL validation so when a user submits the form, the validation check takes place, and if it fails - then redirect the user to a different page (canceling out all other completion events such as emails, pdfs, etc.)
We are getting a “database does not exist message”.
We know we can reach our database via our connection string as we can: 1) Successfully run stored procedures to insert records via the form completion event logic 2) Perform field level lookups to the database to populate a combo box field.
We want to move the sql insert/uniquecompletionid SP logic over to the SQL validation area to ensure that if a record is not written to the database, the user is informed (and no other completion events occur).
When we attempt to implement this…we get the following error suggesting that our “TeacherEd” database does not exist (even though we access it through the two methods above).
We are on the following versions: DF = Ver:4.10.0.5601 / DNN = 6.2.0 After our declares and sets, we have our stored procedure and @isvalid logic as shown below:
EXEC [TeacherEd].[dbo].[sp_Entry_LOA_Insert] @UniqueCompletionID, @ResponseDateTime, @UserID, @IPAddress, @FirstName, @LastName, @Email, @School, @Grade, @Content, @Date, @ClinicFaculty, @UnisupVisor, @DateTimeofLeave, @EndDateTimeLeave, @TypeofLeave, @ReasonofAbs
IF (SELECT COUNT(*) FROM [TeacherEd].[dbo].[Form_Entry_LOA] where UniqueCompletionID = @UniqueCompletionID) = 1
BEGIN SET @isValid= 'True' END ELSE BEGIN SET @isValid = 'False' END
The Error that is generated: Error: Leave of Absence Form is currently unavailable. DotNetNuke.Services.Exceptions.ModuleLoadException: Database 'TeacherEd' does not exist. Make sure that the name is entered correctly. ---> System.Data.SqlClient.SqlException: Database 'TeacherEd' does not exist. Make sure that the name is entered correctly. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlDataReader.ConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior) at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader(SqlConnection connection, SqlTransaction transaction, CommandType commandType, String commandText, SqlParameter[] commandParameters, SqlConnectionOwnership connectionOwnership) at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters) at DataSprings.Modules.DynamicForms.SqlDataProvider.GetSQLDefault(String strSQL, String strAltConnection) at DataSprings.Modules.DynamicForms.DynamicQuestionController.GetSQLValidation(String strSQL) at DataSprings.Modules.DynamicForms.DynamicForms.ServerSideValidation() at DataSprings.Modules.DynamicForms.DynamicForms.SubmitForm(Boolean ProcessPaymentNotification, String strResponseID, Boolean blnByPassValidation, Boolean blnSaveForLater) --- End of inner exception stack trace ---
Any help on this would be awesome. |