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!

Formatting SQL Driven Options
Last Post 05-31-2009 04:15 PM by Shane Leslie. 6 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Shane LeslieUser is Offline
going with the flow
going with the flow
Posts:34
Avatar

--
05-03-2009 07:44 AM

    Hey All,

     

    I'm working on a form that returns a listing of the products contained in the database.  I want the list (that gets returned) to be selectable.

     

    The data is coming back just fine, but my problem is the formatting needs some adjustment.  Whatever formatting that gets specified in SQL, is not coming through and being displayed correctly.  The following is an example:

     

    In SQL, I wrote a function that creates a return string that is formatted as well: SELECT @r = ModelNum + space(4) + Frequency + space(4) + [Isolation] FROM dbo.MTC_Products WHERE ModelNum

     

    In the form, the control ignores the "space(4)" commands, and replaces them with a single space.  I have tried all the possible selection controls, and the formatting does not come through.  I have even tried using spaces within a single quoation...nothing seems to work.

     

    Is there another way?

     

    Thanks in Advance,

    -Shane

    David ToUser is Offline
    river guide
    river guide
    Posts:2719
    Avatar

    --
    05-04-2009 07:19 AM
    HI, your SQL statement should be something like:
    select ((firstname)+' ' +(lastname)) as questionoption, userid as questionoptionvalue from {objectQualifier}users
    So in your case, try the following SQL statement:
    select (ModelNum + space(4) + Frequency + space(4) + [Isolation]) as questionoption, (ModelNum + space(4) + Frequency + space(4) + [Isolation]) as questionoptionvalue from dbo.MTC_Products

    -- David
    Shane LeslieUser is Offline
    going with the flow
    going with the flow
    Posts:34
    Avatar

    --
    05-04-2009 07:46 AM

    David,

     

    Thanks for the fast response...

     

    Actually, my SQL statement was as follows:

     

    SELECT ModelNum as QuestionOptionValue, dbo.getMTC_Products(ModelNum) as QuestionOption FROM dbo.MTC_Products WHERE FreqCode = '$(Freq)'

     

    If I am not mistaken, that follows the necessary criteria for retrieving data.  Within the "getMTCProducts()" function is where I was formatting the return string. 

     

    I just tried your suggestion, and the formatting did not return still.  I am using version 2.70.05.

     

    Do you have any other ideas?

     

    Thanks,

    -Shane

    David ToUser is Offline
    river guide
    river guide
    Posts:2719
    Avatar

    --
    05-04-2009 08:10 AM
    Hi, QuestionOption should come before QuestionOptionValue. Also, can you try executing this statement under HOST / SQL and see what it returns, although under HOST / SQL you may have to hardcode in the value for '$(Freq)'
    -- David
    Shane LeslieUser is Offline
    going with the flow
    going with the flow
    Posts:34
    Avatar

    --
    05-14-2009 05:16 AM

    David,

     

    I made some corrections to the SQL statement as follows:

     

    select (ModelNum + space(4) + Frequency + space(4) + [Isolation]) as questionoption, (ModelNum + space(4) + Frequency + space(4) + [Isolation]) as questionoptionvalue from dbo.MTC_Products

     

    I tried running this in the SQL editor within DNN, and the formatting still does not come through properly.  Everywhere it states "space(4)", it only puts a single space.  In SQL Server, the return looks properly formatted...

     

    Do you have any other suggestions?

     

    Thanks,

    -Shane

    David ToUser is Offline
    river guide
    river guide
    Posts:2719
    Avatar

    --
    05-14-2009 06:08 AM
    HI Shane, nothing wrong with the SQL statement. It works fine when I tried the space(4) under SQL Management Studio but when I tried it in DNN HOST / SQL, all the spacing gets stripped. Maybe it's a DNN configuration setting somewhere. -- David
    Shane LeslieUser is Offline
    going with the flow
    going with the flow
    Posts:34
    Avatar

    --
    05-31-2009 04:15 PM

    Thanks Dave for the help.  I found out what the solution is and I thought I would report back to let everyone else know as well.

     

    In Host/SQL, it actually posts back the results in HTML.  I replaced the space(4) with 'nbsp' (with the andpersand and semi colon) and everything works like a champ.  The spacing comes through and with a little time, I can get everything lined up as it should.

     

    Thanks again,

    -Shane

    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