|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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?
|
|
#2
|
|||
|
|||
|
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.
|
![]() |
| Viewing: ASP Free Forums > Programming > .NET Development > Matching date values w/ dropdown values |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|