Great Ideas. Always Flowing.

We are not happy until you are happy. Client satisfaction guaranteed. Whatever your needs and requirements, we have the skills and resources for the job!

Quick login...


Or... now make it easy with Facebook Integration
Connect via Facebook



Top Sellers

Frustrated over the lack of customization for your user's registration fields? Dynamically setup your DNN Portal with custom registration fields, layout, questions, and other core integration options......

Ultra Video Gallery is a brother product of Ultra Media Gallery, UVG allows you to upload videos in various format and automatically encode them to flv or H264 format, you also can add videos from internet or record live videos from your webcam.

Build high performance, completely customizable data-entry forms and views driven by your DNN and external databases. New built-in tools make it a snap to quickly create data entry forms, data views, and even database tables. Plus, add your own HTML, CSS, Javascript, SQL commands, stored procedures,

The most advanced DotNetNuke shopping cart on the planet. Easy to use e-Commerce, Secure Shopping Cart Software and SEO friendly. B2C / B2B Ecommerce Sites.

One stop solution for events calendar and events registration! FREE DOWNLOAD is available now!

Store Procedure Execution - Continuation
Last Post 01-20-2011 03:53 PM by Ryan Bakerink. 5 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
ChuckUser is Offline
river guide
river guide
Posts:157
Avatar

--
12-08-2010 06:31 AM
    I basically have a form that I have setup where the following events happens:

    1.  User clicks on SUBMIT button
    2.  User gets and e-mail created from the FORM COMPLETION EVENT
    3.  USER gets redirected to another page from the FORM COMPLETION EVENT
    4.  Form data gets inserted using a Stored procedure from the FORM COMPLETION EVENT

    My question is that if an error happens while on Insert Stored Procedure in the database, how can I get DF not to continue to the E-mail being generated and the USER getting redirected.  Basically, I dont want the Form page to proceed until the records get inserted successfully.

    Can you give me an idea on what I need to do?

    Thanks,
    Chuck
    Ryan BakerinkUser is Offline
    river guide
    river guide
    Posts:1900
    Avatar

    --
    12-09-2010 08:02 AM
    Hello Chuck,

    The only uncomplicated nightmare of a way I can come up with doing this is by using SQL Validation under Module Configuration.

    So basically you will have a condition and this is only psuedocode:

    declare @isValid nvarchar(200)

    IF
    BEGIN
    exec storedProcedure '$(token)', '$(token2)'

    --If this inserts correctly return true

    set @isValid = 'True'

    END

    ELSE
    BEGIN

    --IF your storedProcedure doesn't insert
    --correctly return false

    set @isValid = 'False'
    END


    Then if this procedure doesn't pass the SQL validation(if it falls under the procedure failing) then the form is considered valid and your email completion event and any other form completion events can be fired after this validation is passed.


    If you have any questions please let me know.
    ChuckUser is Offline
    river guide
    river guide
    Posts:157
    Avatar

    --
    12-09-2010 11:59 AM

    Posted By Ryan Bakerink on 09 Dec 2010 10:02 AM
    Hello Chuck,

    The only uncomplicated nightmare of a way I can come up with doing this is by using SQL Validation under Module Configuration.

    So basically you will have a condition and this is only psuedocode:

    declare @isValid nvarchar(200)

    IF
    BEGIN
    exec storedProcedure '$(token)', '$(token2)'

    --If this inserts correctly return true

    set @isValid = 'True'

    END

    ELSE
    BEGIN

    --IF your storedProcedure doesn't insert
    --correctly return false

    set @isValid = 'False'
    END


    Then if this procedure doesn't pass the SQL validation(if it falls under the procedure failing) then the form is considered valid and your email completion event and any other form completion events can be fired after this validation is passed.


    If you have any questions please let me know.


    Hi Ryan,
    Thanks for the idea. I see where you are going with this. I know this is a rough mock of the code but I am having trouble coding it correctly.

    How is it possible to use an
    IF statement without a condition, followed by a BEGIN and a stored procedure execution? Can you be more clear on what I can use for the IF part to proceed to the execution of the stored procedure?
    Ryan BakerinkUser is Offline
    river guide
    river guide
    Posts:1900
    Avatar

    --
    12-09-2010 01:16 PM
    Hello Chuck,

    Lets say your SP looks like this:

    CREATE PROCEDURE usp_SP
    (
    @varOne NVARCHAR(200),
    @varTwo NVARCHAR(200),
    @uniqueID NVARCHAR(200)
    )

    As
    BEGIN
    INSERT INTO yourTable(column1, column2, uniqueID)
    VALUES(@varOne, @varTwo, @uniqueID)
    END


    Lets down below is what you're passing to the stored procedure(this code will go in your SQL Validation section under Module Configuration)

    Start by running the SP and passing the values to the SP:

    -------------------------------------

    DECLARE @varOne NVARCHAR(200)
    DECLARE @varTwo NVARCHAR(200)
    DECLARE @uniqueID NVARCHAR(200)

    DECLARE @isValid NVARCHAR(200)

    SET @varOne = '$(Token1)'
    SET @varTwo = '$(Token2)'
    SET @uniqueID = '$(TokenUniqueID)'


    EXEC usp_SP @varOne, @varTwo, @varThree

    IF (SELECT COUNT(*) FROM yourTable where uniqueID = @uniqueID) = 1
    BEGIN
    SET @isValid= 'True'
    END

    ELSE
    BEGIN
    SET @isValid = 'False'
    END

    ----------------------------------------


    This way if one record exists then you know it inserted correctly, else is basically 0 or more than one so you can account for that if you'd like. If else is the condition then the SQL validation will fail and the form won't be submitted and the form completion events won't fire.

    Please let me know if this helps and again this is only a structure and none of these tables, stored procedures, or columns exist, so make this syntax and logic fit your needs.

    Thanks,

    Ryan

    ChuckUser is Offline
    river guide
    river guide
    Posts:157
    Avatar

    --
    12-10-2010 09:42 AM

    Posted By Ryan Bakerink on 09 Dec 2010 03:16 PM
    Hello Chuck,

    Lets say your SP looks like this:

    CREATE PROCEDURE usp_SP
    (
    @varOne NVARCHAR(200),
    @varTwo NVARCHAR(200),
    @uniqueID NVARCHAR(200)
    )

    As
    BEGIN
    INSERT INTO yourTable(column1, column2, uniqueID)
    VALUES(@varOne, @varTwo, @uniqueID)
    END


    Lets down below is what you're passing to the stored procedure(this code will go in your SQL Validation section under Module Configuration)

    Start by running the SP and passing the values to the SP:

    -------------------------------------

    DECLARE @varOne NVARCHAR(200)
    DECLARE @varTwo NVARCHAR(200)
    DECLARE @uniqueID NVARCHAR(200)

    DECLARE @isValid NVARCHAR(200)

    SET @varOne = '$(Token1)'
    SET @varTwo = '$(Token2)'
    SET @uniqueID = '$(TokenUniqueID)'


    EXEC usp_SP @varOne, @varTwo, @varThree

    IF (SELECT COUNT(*) FROM yourTable where uniqueID = @uniqueID) = 1
    BEGIN
    SET @isValid= 'True'
    END

    ELSE
    BEGIN
    SET @isValid = 'False'
    END

    ----------------------------------------


    This way if one record exists then you know it inserted correctly, else is basically 0 or more than one so you can account for that if you'd like. If else is the condition then the SQL validation will fail and the form won't be submitted and the form completion events won't fire.

    Please let me know if this helps and again this is only a structure and none of these tables, stored procedures, or columns exist, so make this syntax and logic fit your needs.

    Thanks,

    Ryan




    Hello Ryan,
    Thank you so much. I now understand the logic. This sample has helped out greatly.

    Thanks again.
    Ryan BakerinkUser is Offline
    river guide
    river guide
    Posts:1900
    Avatar

    --
    01-20-2011 03:53 PM
    Hello Chuck,

    No problem if you ever have any questions please let me know.

    Thanks,

    Ryan
    You are not authorized to post a reply.


     
     

    Join our mailing list...

    Get current news and events the easy way
    Subscribe Me

    Recent Blogs...

     
    Copyright 2005 - 2011 by Data Springs, Inc.
     
  • film izle
  • 720 izle
  • film
  • sinema izle
  • film makinesi
  • T�rk�e dublaj film
  • film izle
  • film izle
  • baglan film izle
  • sinema izle
  • 1080 film izle
  • film mercegi