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!

how do you pass a combobox selection to querystring?
Last Post 01-19-2010 06:04 AM by Richard Bailey. 1 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
threeoUser is Offline
skipping stones
skipping stones
Posts:9
Avatar

--
01-18-2010 11:21 AM

    anyone know how to pass a combobox seletion to the querystring?

    a textbox is simple enough and very straight forward but when i try the same method with a combobox....it always returns a null

    Richard BaileyUser is Offline
    going with the flow
    going with the flow
    Posts:66
    Avatar

    --
    01-19-2010 06:04 AM
    I had to write some SQL udf's to handle this.

    The combo box is sent to SQL as a comma-delimited string (e.g. "1,2,3,4,5,6") Make sure to note there are no spaces in that string either.


    I wrote a UDF to handle inserts of these values, as well as to retrieve them...

    For inserts, @combobox_commastring is the comma delimited string that is holding the "1,2,3,5,6,7" or whatever are the values passed from your combobox


    declare @string varchar(500)
    set @string = @combobox_commastring
    declare @pos int
    declare @piece varchar(500)
    -- Need to tack a delimiter onto the end of the input string if one doesn't exist
    if right(rtrim(@string),1) <> ','
    set @string = @string + ','
    set @pos = patindex('%,%' , @string)
    while @pos <> 0
    begin
    set @piece = left(@string, @pos - 1)

    -- Insert the individual values in to a unique row
    INSERT INTO combo_boxvalues ([relational_id], [single_value], [IsActive],[CreateDateTime])
    Values (@relational_id, cast(@piece as int),'1',getdate())

    set @string = stuff(@string, 1, @pos, '')
    set @pos = patindex('%,%' , @string)
    end
    END



    To retrieve the values, assume you need them for SQL Bind or whatever... the UDF below will create a comma-delimited string

    CREATE FUNCTION [dbo].[udf_Get_delimited_string](@relational_id varchar(50))
    RETURNS VARCHAR(1000)AS

    BEGIN
    DECLARE @ComboBoxValues varchar(1000)

    SELECT @ComboBoxValues = COALESCE(@ComboBoxValues + ',', '') + s.single_value
    FROM [combobox_values] s
    WHERE (s.relational_id = @relational_id) and (s.IsActive = '1')


    RETURN @ComboBoxValues
    END

    Then, to use this UDF in the SQL Bind (better to put it in a stored procedure of course)

    select relational_id, field1, field2, field3, [dbo].[udf_Get_delimited_string] (relational_id) as combo_box_values_field, field5, field6 from my table
    where my_condition = 'met'
    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