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!

Inital SQL Rendering/Bind - Passing DSParam
Last Post 11-19-2010 02:26 PM by Ryan Bakerink. 6 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

--
11-19-2010 07:01 AM
    In my Initial SQL Query Rendering Bind, I have:
    usp_Worksheet '$(DSParam1)','$(DSParam2)','$(DSParam3)','$(DSParam4)'

    The values that I am passing into my store procedure are:
    @DSParam1 as int,
    @DSParam2 as int,
    @DSParam3 as varchar(10),
    @DSParam4 as varchar(10)

    Whereas  each represent
    DSParam1=315
    DSParam2=2010
    DSParam3=2010-9-1
    DSParam4=2010-9-30

    When I run these variable in my stored procedure to test as:

    Declare @DSParam1 int
    Declare @DSParam2 int
    Declare @DSParam3 varchar(10)
    Declare @DSParam4 varchar(10)
        
    set @DSParam1 = 315
    set @DSParam2 = 2010
    set @DSParam3 = '2010-8-1'
    set @DSParam4 = '2010-8-31'

    Everything is outputted correctly in my SQL Server Studio test.  But when I attempt to run this on my DF.  I get nothing.  I have narrowed it down to the variables DSParam3 and DSParam4, for some reason passing the date values in my store procedure from DF has it failing.

    Can anyone give me any insight on what I may be doing wrong using this method?

    -Chuck

    Ryan BakerinkUser is Offline
    river guide
    river guide
    Posts:1900
    Avatar

    --
    11-19-2010 08:02 AM
    Hello Chuck,

    You may want to attach this to your URL like so:

    www.yoursite.com?debug=true

    or if querystring parameters exist in the URL already then use this syntax:

    www.yoursite.com?DSParam3 = 2010&debug=true

    This will help you see why the Initial SQL databinding failed.


    Also another thing I would like to mention is that if DSParam3 and DSParam4 are datefields you should definitely change the data type to type datetime.

    Then if you need to format the date you can format it like so:

    Convert(char(10), @DSParam3, 101) As YourAliasName
    Convert(char(10), @DSParam3, 102) As YourAliasName
    Convert(char(10), @DSParam3, 103) As YourAliasName
    Convert(char(10), @DSParam3, 104) As YourAliasName

    NOTE: The only thing that's changing is the 101,102, 103, and 104. These are the date formats.

    For instance you can format dates in multiple formats:

    05/10/2010
    05-10-2010
    2010-10-05
    2010/10/05
    10-05-2010

    The format number will format the date in the way you'd like.

    If you have any questions please let me know.

    Thanks,

    Ryan
    ChuckUser is Offline
    river guide
    river guide
    Posts:157
    Avatar

    --
    11-19-2010 10:35 AM
    Hi Ryan,

    Thanks for the debug tip.

    When I run it, it looks like this:
    WorksheetStep2NonLEC.aspx?DSParam1=315&DSParam2=2010&DSParam3=2010-9-1&DSParam4=2010-9-30&debug=true

    Attempting SQL Data Bind:usp_UserWorksheet '315','2010','2010-9-1','$(DSParam4)'
    Failed SQL Data Bind:usp_UserWorksheet '315','2010','2010-11-1','$(DSParam4)'

    So a followup question.  Does this mean its not passing the $DSParam4 into the SQL Data Bind?  If so, is there a limit when passing a parameter into a stored procedure e.g.  $DSParam1, $DSParam2 and $DSParam3 only...$DSParam4 is not allowed?

    Or does this mean in my stored procedure where I am using the @DSParam4, it does not like the format?

    Thoughts?
    -Chuck
    ChuckUser is Offline
    river guide
    river guide
    Posts:157
    Avatar

    --
    11-19-2010 12:13 PM
    Hello Ryan,
    I was able to work around my issue with the $DSParam4 parameter.  For some reason, it does not like me passing that value even if it was set exactly as my $DSParam3 setup.  So I removed it and created another parameter inside my stored procedure to work off my $DSParam3 being passed and all is well.

    If you can verify for me if there is a limitation of only 3 parameters to pass into a SQL Bind, that would be great.

    BTW I am using DF 3.3.40.0 which I know there has been more recent versions out there but for now I need to work with this one.

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

    --
    11-19-2010 12:34 PM
    Hello Chuck,

    Now that I think of it, there are only DSParam1, DSParam2, and DSParam3 in Dynamic Forms. DSParam4 doesn't exist. I completely missed this concept when you said you were using these 4 parameters. So possibly DSParam4 wasn't recognized as a querystring token.

    But technically you can use as many  parameters that you'd like in SQL binding. I just find it odd that DSParam4 didn't work. What did you name the 4th parameter if you don't mind me asking?

    If you have any questions please let me know.

    Thanks,

    Ryan
    ChuckUser is Offline
    river guide
    river guide
    Posts:157
    Avatar

    --
    11-19-2010 12:50 PM
    Hi Ryan,
    Basically what I was trying to do is pass my 4th parameter as an end of day of the month from a hiddenfield   e.g. $(DSParam4) would have been '2010-9-30'

    But since I was passing a $(DSparam3) which represented the first day of the month e.g. $(DSParam3) would have been '2010-9-1'

    So what I did in my SQL store procedure, passed the 3 parameters in and within the stored procedure created another parameter to get my end of month variable.

    e.g.

    ALTER PROCEDURE [dbo].[usp_UserWorksheet_Step3]
        -- Add the parameters for the stored procedure here
        @DSParam1 int,
        @DSParam2 int,
        @DSParam3 varchar(10)
    AS
    BEGIN
        DECLARE @pass_DSParam3 datetime
        DECLARE @pass_DSParam4 int
        DECLARE @pass_DSParam5 datetime
        
        -- Format to yyyy-mm-dd
        SET @pass_DSParam3 = CONVERT(VARCHAR(10), @DSParam3, 120)
        -- Find Days in Month for @pass_DSParam3
        SET @pass_DSParam4 = (SELECT DAY(DATEADD(d, -DAY(DATEADD(m,1,@pass_DSParam3)),DATEADD(m,1,@pass_DSParam3))))
        -- create format for end of month date based on @pass_DSParam3 and @pass_DSParam4
        SET @pass_DSParam5 = (SELECT DATEADD(day, @pass_DSParam4, @pass_DSParam3))

    <----- SQL Select code omitted ---->

    As you can see I accomplished my goal by creating 3 new parameters within it to be used in the SQL select code further down that I would pass into my DF fields.

    Hope this makes sense.

    Thanks again.
    -Chuck


    Ryan BakerinkUser is Offline
    river guide
    river guide
    Posts:1900
    Avatar

    --
    11-19-2010 02:26 PM
    Hello Chuck,

    This makes perfect sense now that I see the SQL script. Seeing the script is easier than trying to explain how something works.

    This will be a great resource if someone runs into a similar issue. This forum thread is going into my library of great contributions.

    Have a great weekend Chuck,

    -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