"Select country"
Last Post 10-06-2009 10:22 PM by Chad Nash. 10 Replies.
AddThis - Bookmarking and Sharing Button
Author Messages
PerryUser is Offline
going with the flow
going with the flow
Posts:50
Avatar

--
09-27-2009 04:16 AM

    Hi, We use combo box - SQL option for coutry filed. Is that possible to have a defult value of "Selection country" on top of country the list? Thank you, Perry 

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

    --
    09-28-2009 06:38 AM
    Yes, you can use the union all statement. Try this:

    select '-- Select a Country --' as question option, '-- Select a Country --' as questionoptionvalue union all
    select Text as QuestionOption, Text as QuestionOptionValue from Lists where ListName= 'Country'

    -- David
    PerryUser is Offline
    going with the flow
    going with the flow
    Posts:50
    Avatar

    --
    09-28-2009 07:17 AM

    The dropdown list became empty after the statement was applied. Anything else that I may miss? Thanks, David 

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

    --
    09-28-2009 07:18 AM
    Correct SQL statement is:

    select '-- Select a Country --' as questionoption, '-- Select a Country --' as questionoptionvalue union all
    select Text as QuestionOption, Text as QuestionOptionValue from Lists where ListName= 'Country'

    I accidentally had a space between 'question option' in the first post. -- David
    PerryUser is Offline
    going with the flow
    going with the flow
    Posts:50
    Avatar

    --
    09-28-2009 05:55 PM

    The correct SQL statement was applied, but the Test SQL was failed with "SQL error!". I also tested on your test/demo site, it works perfectly. so, what is wrong with my site? I am runing on "localhost". -- Perry

    PerryUser is Offline
    going with the flow
    going with the flow
    Posts:50
    Avatar

    --
    09-28-2009 06:18 PM
    It appeared a page error message "Webpage error details

    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; GTB6; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; OfficeLiveConnector.1.3; OfficeLivePatch.0.0; .NET CLR 3.5.30729; .NET CLR 3.0.30618)
    Timestamp: Tue, 29 Sep 2009 03:13:34 UTC


    Message: Object doesn't support this property or method
    Line: 23
    Char: 9
    Code: 0
    URI: http://localhost/Resources/Shared/s...Widgets.js


    Message: Object doesn't support this property or method
    Line: 485
    Char: 6
    Code: 0
    URI: http://localhost//tabid/152/ctl/Edi...fault.aspx

    PerryUser is Offline
    going with the flow
    going with the flow
    Posts:50
    Avatar

    --
    09-28-2009 10:31 PM

    I revised the second part of the SQL statement as: select Text as QuestionOption, Text as QuestionOptionValue from {objectQualifier}Lists where ListName= 'Country'. Then the country list was appeared, but the "--Select country--" did not come up. Any suggestion please. -- Perry  

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

    --
    09-29-2009 06:31 AM
    HI, didn't know you had objectqualifier on your DNN database site. But the SQL union all statement should work:

    select '-- Select a Country --' as questionoption, '-- Select a Country --' as questionoptionvalue
    union all
    select Text as QuestionOption, Text as QuestionOptionValue from {objectQualifier}Lists where ListName= 'Country'

    Can you try typing this in host / SQL and see what gets returned? -- David
    PerryUser is Offline
    going with the flow
    going with the flow
    Posts:50
    Avatar

    --
    09-29-2009 08:18 PM

    it works now. thanks.

    PerryUser is Offline
    going with the flow
    going with the flow
    Posts:50
    Avatar

    --
    10-06-2009 09:02 PM
    It seems that the country order cannot be simply adding a query "Order by text" after the following query.

    select '-- Select a Country --' as questionoption, '-- Select a Country --' as questionoptionvalue
    union all
    select Text as QuestionOption, Text as QuestionOptionValue from {objectQualifier}Lists where ListName= 'Country'

    How to set the country list in order in this situation?

    Thanks. -- Perry
    Chad NashUser is Offline
    Posts:5260
    Avatar

    --
    10-06-2009 10:22 PM
    Try this...

    select '-- Select a Country --' as questionoption, '-- Select a Country --' as questionoptionvalue
    union all
    select Text as QuestionOption, Text as QuestionOptionValue from {objectQualifier}Lists where ListName= 'Country'
    Order By QuestionOption


    -Chad


    ---
  • 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