W
Wanda
Hi,
I am trying to read the DropDownList's selectedIndex when it fires the
event
"SelectedIndexChanged", however, the index value is always 0 no matter
what I've clicked. I just wonder what have I done wrong in my code...
This is how I populate my list at the Page_Load!!!!
Dim myCMD As SqlCommand = New SqlCommand(strSQL, cn)
Dim myReader As SqlDataReader = myCMD.ExecuteReader()
Dim fNextResult As Boolean = True
lstEmployee.Items.Clear()
Do Until Not fNextResult
Do While myReader.Read()
If Not myReader.IsDBNull(0) Then
lstEmployee.Items.Add(New
ListItem(myReader.GetString(1), myReader.GetInt32(0)))
End If
Loop
fNextResult = myReader.NextResult()
Loop
myReader.Close()
Thanks in advance. Any help will be greatly appreciated.
Wanda
I am trying to read the DropDownList's selectedIndex when it fires the
event
"SelectedIndexChanged", however, the index value is always 0 no matter
what I've clicked. I just wonder what have I done wrong in my code...
This is how I populate my list at the Page_Load!!!!
Dim myCMD As SqlCommand = New SqlCommand(strSQL, cn)
Dim myReader As SqlDataReader = myCMD.ExecuteReader()
Dim fNextResult As Boolean = True
lstEmployee.Items.Clear()
Do Until Not fNextResult
Do While myReader.Read()
If Not myReader.IsDBNull(0) Then
lstEmployee.Items.Add(New
ListItem(myReader.GetString(1), myReader.GetInt32(0)))
End If
Loop
fNextResult = myReader.NextResult()
Loop
myReader.Close()
Thanks in advance. Any help will be greatly appreciated.
Wanda