Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
Updating listbox with 2 RecordSets (ASP and SQL)
Old 09-27-2006, 11:46 PM Updating listbox with 2 RecordSets (ASP and SQL)
Junior Talker

Posts: 1
Trades: 0
Hi I would like to create a DB driven listbox. one recordset is used to list all the countries into the list. the 2nd recordset is used to add the selected value. But I could only list all the countries into the box and not able to preselect the country. Below is my code and hope someone could highlight to me my mistake.

Thank You,
Mark

<select name="lstCountry">
<%
Do Until rstCountry.EOF
Set objCountry = rstCountry("CountryID")
%>
<option <% if rstCountry("CountryID") = RS("UserCountry") then response.write("selected")%> value = "<%=rstCountry("CountryID")%>">
<%=rstCountry("CountryName")%>
</option>
<%rstCountry.MoveNext%>
<% Loop%>
</select>
superkid is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Reply     « Reply to Updating listbox with 2 RecordSets (ASP and SQL)
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.12423 seconds with 12 queries