.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old February 26th, 2003, 09:04 PM
joephoenix joephoenix is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 26 joephoenix User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Matching date values w/ dropdown values

In my program, I have 6 ddl's filled programatically with date info (month, day & year) in my client-side code. Based on a selection in a listbox, the ddl's show date info for the selection based on a SQL SELECT statement in my (VB) server-side code; the problem is the date parts returned had no value. I wanted to match what was returned with values I had put in the dropdowns programatically. For example, if the day from SQL was the 3rd, I'd want it to show up in the list at the 3 that I've inserted on client-side, like so:<br><br>1<br>2<br>3 <--<br>4<br>5<br><br>Right now it comes up like this:<br><br>3 <--<br>1<br>2<br>3<br>4<br>5<br><img src="/forum/emoticons/shakehead.gif" alt="shakehead"> <br>How can this be corrected?

Reply With Quote
  #2  
Old February 28th, 2003, 07:07 PM
joephoenix joephoenix is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 26 joephoenix User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
In case anyone's confused, here's the pertinent code I have. First the vb stuff:<br><div class="msgQuoteWrap"><div class="msgCode"><br>Dim dateInfo As New System.Globalization.DateTimeFormatInfo()<br>Dim myDate As DateTime = Trim(objSQLMemoList.returnDataViewValue(intTheSele ctedIndex)("mgt_effectiveStartDate").ToString())<br>ddlMonth.SelectedItem.Text = dateInfo.GetMonthName(myDate.Month)<br>ddlDay.SelectedItem.Text = myDate.Day<br>ddlYear.SelectedItem.Text = myDate.Year<br><br>Dim myDate2 As DateTime = Trim(objSQLMemoList.returnDataViewValue(intTheSele ctedIndex)("mgt_effectiveEndDate").ToString())<br>ddlMonth2.SelectedItem.Text = dateInfo.GetMonthName(myDate2.Month)<br>ddlDay2.SelectedItem.Text = myDate2.Day<br>ddlYear2.SelectedItem.Text = myDate2.Year<br></div></div><br><br>Apparently I can't post the aspx tags here. <img src="/forum/emoticons/nono.gif" alt="nono"> So let me describe; I have hard coded values for my ddl's for the months and days and years. I want the SQL values to match with what I've hard-coded.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgramming.NET Development > Matching date values w/ dropdown values


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT