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!

Trying to add UserID to Demonstration 13
Last Post 07-20-2008 01:24 PM by John Crichton. 0 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
John CrichtonUser is Offline
new to the springs
new to the springs
Posts:1
Avatar

--
07-20-2008 01:24 PM

    I am trying to add the form parameter user id to the sql query in demonstration 13.

    Can someone modify this sproc to include the USERID on the Form.  I would like to pass the moduleid and the userid

    What is the proper way to pass that variable from a Dynamic Form

    Thanks,

    Here is the sproc in the example.

    set ANSI_NULLS ON
    set QUOTED_IDENTIFIER ON
    go
    
    CREATE  Procedure [dbo].[DynamicForms_ExportFormResults_ForTraining]
    
    @ModuleID int
    
    AS
    
    
    Declare curBubba Cursor
    FOR
    SELECT Question, DynamicQuestionID
    FROM dynamicforms_question 
    where QuestionType <> 'HTML' 
    AND QuestionType <> 'HR' 
    AND InActive=0 
    AND ModuleID = 1113
    AND Question <> 'Postal Code' 
    
    ORDER BY SortOrder
    FOR READ ONLY;
    
    Declare @Question VarChar(500);
    Declare @DynamicQuestionID uniqueidentifier;
    Declare @SQLToUse VarChar(8000);
    Declare @SQLToUseJoin VarChar(8000);
    Declare @SQLToExecute Varchar(8000);
    Declare @Alias 	  VarChar(10);
    
    Declare @intCounter Int;
    
    set @Question = '';
    set @SQLToUse = '';
    set @intCounter = 0;
    set @Alias = '';
    set @SQLToUseJoin = '';
    
    OPEN curBubba;
    FETCH NEXT FROM curBubba INTO @Question, @DynamicQuestionID;
    
    WHILE @@FETCH_STATUS = 0
    BEGIN
    
    	set @intCounter = @intCounter + 1;
    
    	set @Alias = '[RJoin_' + CAST(@intCounter as varchar(20)) + ']';
    
    	if DataLength(@SQLToUse) = 0
    	BEGIN
    		set @SQLToUse = 'SELECT IsNull(' + @Alias + '.response,''N/A'') as [' + @Question + '] '
    		set @SQLToUseJoin = ' 
    From (
      SELECT  distinct Y.uniqueresponseID, Y.UserID, B.UserName
      from [DynamicForms_QuestionResponse] As Y
      inner join DynamicForms_Question  as Z on (Y.DynamicQuestionID = Z.DynamicQuestionID)
      Left Outer Join Users B on B.UserID = Y.UserID 
      where Z.ModuleID = ' + Cast(@ModuleID as varchar(20)) + ' 
    ) As A 
    Left Outer join DynamicForms_QuestionResponse as ' + @Alias + ' on (A.uniqueresponseID = ' + @Alias + '.uniqueresponseID and ''' + Cast(@DynamicQuestionID as varchar(50))+ ''' = ' + @Alias + '.DynamicQuestionID)
    '
    	END
    	ELSE
    	BEGIN
    		set @SQLToUse = @SQLToUse + ', ' + @Alias + '.response as [' + @Question + '] '
    		set @SQLToUseJoin = @SQLToUseJoin + 'Left Outer join DynamicForms_QuestionResponse as ' + @Alias + ' on (A.uniqueresponseID = ' + @Alias + '.uniqueresponseID and ''' + Cast(@DynamicQuestionID as varchar(50))+ ''' = ' + @Alias + '.DynamicQuestionID) 
    '
    	END;	
    
       	FETCH NEXT FROM curBubba INTO @Question, @DynamicQuestionID;
    END
    
    CLOSE curBubba;
    DEALLOCATE curBubba;
    
    Set @SQLToExecute = Convert(varchar(8000), @SQLToUse) + Convert(varchar(8000), @SQLToUseJoin) 
    
    --set @SQLToExecute = @SQLToUse + @SQLToUseJoin 
    --print @SQLToExecute
    EXEC(@SQLToExecute);

     

    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.